/* =============================================================================
   City of Page Mega Menu
   Drop into: wp-content/themes/hello-elementor-child/assets/mega-menu.css
   ========================================================================== */

/* --- Base nav ---------------------------------------------------------- */
.cop-mega-nav {
    position: relative;
    width: 100%;
    font-family: inherit;
}

.cop-mega-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2.5rem;
    align-items: center;
}

/* --- Top-level items --------------------------------------------------- */
.cop-top-item {
    position: static; /* Panel positions relative to nav, not item */
}

.cop-top-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    background: transparent;
    border: 0;
    padding: 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s ease;
}

.cop-top-link:hover,
.cop-top-item.is-open > .cop-top-link {
    color: #0073aa;
}

.cop-chevron {
    font-size: 0.8em;
    transition: transform 0.2s;
}

.cop-top-item.is-open .cop-chevron {
    transform: rotate(180deg);
}

/* --- Mega panel -------------------------------------------------------- */
.cop-mega-panel {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* Controlled by JS .is-open class */
    width: 95vw;
    max-width: 1100px;
    background: #fff;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* Layout logic: Image + Content */
.cop-mega-panel.has-image {
    grid-template-columns: 320px 1fr;
}

.cop-mega-panel.no-image {
    grid-template-columns: 1fr;
}

/* Activation state */
.cop-top-item.is-open .cop-mega-panel {
    display: grid !important;
}

/* --- Mega image sidebar ------------------------------------------------ */
.cop-mega-image {
    position: relative;
    background: #f4f4f4;
    height: 100%;
    min-height: 450px;
}

.cop-mega-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cop-mega-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.5rem 1.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
}

.cop-mega-caption-title {
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.2;
}

.cop-mega-caption-sub {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 4px;
}

/* --- Content Grid ------------------------------------------------------ */
.cop-mega-grid {
    padding: 2.5rem;
    background: #fff;
}

/* This forces the 2-column layout for the links */
ul.cop-mega-items {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem 2.5rem !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cop-mega-item {
    margin: 0;
    padding: 0;
}

.cop-mega-item > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: #444;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.cop-mega-item > a i {
    width: 20px;
    text-align: center;
    color: #0073aa;
    font-size: 1rem;
}

.cop-mega-item > a:hover {
    background: #f0f7ff;
    color: #0073aa;
    padding-left: 16px;
}

/* --- Nested (Third Level) Menu (e.g., Meal Menu) ---------------------- */
.cop-mega-submenu {
    list-style: none !important;
    margin: 4px 0 12px 2.8rem !important;
    padding: 0 !important;
    border-left: 2px solid #eee;
}

.cop-mega-submenu li {
    margin: 0;
}

.cop-mega-submenu li a {
    display: block;
    padding: 4px 15px;
    font-size: 0.95rem;
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.cop-mega-submenu li a::before {
    content: "> ";
    font-weight: bold;
    color: #bbb;
    margin-right: 4px;
}

.cop-mega-submenu li a:hover {
    color: #0073aa;
}

/* --- Mobile / Hamburger Toggle ----------------------------------------- */
.cop-mobile-toggle {
    display: none;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.cop-hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    position: relative;
}

.cop-hamburger::before,
.cop-hamburger::after {
    content: '';
    width: 24px;
    height: 2px;
    background: #333;
    position: absolute;
    left: 0;
}

.cop-hamburger::before { top: -8px; }
.cop-hamburger::after  { top: 8px; }

/* --- Mobile Responsiveness -------------------------------------------- */
@media (max-width: 1024px) {
    .cop-mega-list { gap: 1.5rem; }
}

@media (max-width: 960px) {
    .cop-mobile-toggle { display: block; }
    
    .cop-mega-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: #fff;
        padding: 1rem 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    }

    .cop-mega-nav.is-mobile-open .cop-mega-list { display: flex; }

    .cop-mega-panel {
        position: static;
        transform: none;
        width: 100%;
        box-shadow: none;
        border: none;
        display: none;
        grid-template-columns: 1fr !important;
    }

    .cop-mega-image { display: none; } /* Hide heavy images on mobile */
    
    ul.cop-mega-items {
        grid-template-columns: 1fr !important;
        padding: 1rem !important;
    }
}