/*
 * DT Mega Menu Styles
 * -------------------
 * This file controls the desktop mega menu, including
 * the top-level bar and the multi-column dropdown panel.
 */

/* --- 0. Hide on Mobile --- */
@media (max-width: 1023px) {
    .my-mega-menu {
        display: none !important;
    }
}

/* --- 1. The Main Header Card (Theme-Specific) --- */
.site-header {
    background: #fff !important;
    border: 2px solid #a987c2 !important; /* Purple Border */
    border-radius: 1rem !important;        /* Rounded Card Look */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    
    /* FIX: RESTORED STICKY LOGIC */
    position: fixed !important; 
    top: 40px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 95% !important;
    max-width: 1400px !important;
    
    z-index: 1000 !important;
    margin: 0 !important; /* Removed 10px 20px margin to prevent alignment jump */
    transition: border-bottom-left-radius 0.3s ease, border-bottom-right-radius 0.3s ease !important;
}

.site-header > .header-inner {
    position: relative;
    z-index: 1002;
    border-radius: 0.85rem;
    transition: border-bottom-left-radius 0.3s ease, border-bottom-right-radius 0.3s ease;
}

/* --- 2. The Top-Level Menu Container (FIXED FOR LOGGED-IN STATE) --- */
.my-mega-menu {
    display: flex;
    align-items: center;
    height: 100%;
    flex-grow: 1; /* Ensures it takes up available space */
    width: auto;
}

.my-menu-top-level {
    display: flex !important;
    flex-wrap: nowrap !important; /* CRITICAL: Forbids two lines */
    justify-content: space-evenly; /* Distributes items nicely */
    align-items: center;
    width: 100%;
    list-style: none !important;
    margin: 0;
    padding: 0;
}

.my-menu-top-level > li {
    position: static; 
    padding: 1rem 1rem;
    list-style: none !important;
    white-space: nowrap; /* CRITICAL: Prevents text wrapping */
    flex-shrink: 1;      /* Allows slight squish if needed, but prefers staying on one line */
}

.my-menu-top-level > li > a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    transition: color 0.2s ease;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
}

.my-menu-top-level > li:hover > a {
    color: #a987c2;
}

/* --- 3. The Dropdown Panel (Theme-Specific Positioning) --- */
.my-megamenu-panel {
    position: absolute;
    top: 99%; 
    left: -1px;   
    right: -2px;  
    width: auto; /* Full width of .site-header */
    
    background: #fff;
    border: 2px solid #a987c2; 
    border-top: none; 
    
    border-bottom-left-radius: 0.85rem; 
    border-bottom-right-radius: 0.85rem;
    
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    
    z-index: 999;
    
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px); 
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

/* --- 4. Active State (Theme-Specific) --- */
.my-menu-top-level > li.submenu-is-active .my-megamenu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.site-header.menu-is-active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.site-header.menu-is-active > .header-inner {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* --- 5. Panel Inner Layout (Vertical Stack) --- */
.my-megamenu-panel-inner {
    display: flex !important; 
    flex-direction: column !important; /* CRITICAL: Stack content on top of footer */
    gap: 20px !important;
    box-sizing: border-box;
}

/* --- 6. Main Content Wrapper (Horizontal Columns) --- */
/* We wrap the links and featured content so THEY stay side-by-side */
.my-megamenu-main-content {
    display: flex !important;
    flex-wrap: wrap !important; /* Forces the footer to its own line */
    width: 100% !important;
    gap: 20px !important;
}

/* --- 7. Individual Link Column (Flexbox) --- */
.my-menu-column.my-menu-links {
    display: block !important; 
    flex: 1 !important; 
    min-width: 180px; 
}

/* --- 8. Featured "Ad" Column (Flexbox) --- */
.my-menu-column.my-menu-featured {
    display: block !important; 
    flex-basis: 300px !important;  
    flex-shrink: 0 !important;     
    flex-grow: 0 !important;       
    
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    transition: box-shadow 0.3s ease;
    background: #f9f9f9; 
    overflow: hidden;
}
.my-menu-column.my-menu-featured:hover { 
    background: #f0f0f0; 
}

.my-menu-column.my-menu-featured img {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.my-menu-column.my-menu-featured h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #111;
    line-height: 1.4;
    margin: 1rem 1.25rem;
}
.my-menu-column.my-menu-featured p {
    font-size: 0.95em;
    line-height: 1.4;
    color: #555;
    margin: 0 1.25rem 1rem 1.25rem; 
}
.my-menu-column.my-menu-featured:hover h5,
.my-menu-column.my-menu-featured:hover p {
    color: #a987c2;
}

/* --- 9. Link Item Styling (Flexbox) --- */
.my-menu-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    margin-top: 0; /* Ensure spacing from header */
}
.my-menu-links li {
    margin: 0 0 1.5rem 0;
    padding: 0;
    white-space: normal; /* Allow sub-descriptions to wrap naturally inside the dropdown */
}
.my-menu-links li a {
    display: inline-block; 
    padding: 0; 
    text-decoration: none;
    color: #444; 
    border-radius: 0;
}
.my-menu-links li a:hover .sub-link-title {
    color: #a987c2;
}

.my-menu-links .sub-link-title {
    font-size: 1.1rem; 
    font-weight: 600;
    display: block;
    margin-bottom: 0.35rem; 
    color: #111; 
    transition: color 0.2s ease;
}

.my-menu-links .sub-link-description {
    font-size: 0.9em;
    color: #666;
    line-height: 1.3;
    font-family: 'Poppins', sans-serif;
}

/* --- 10. Mega Menu Column Headers (Alignment Fix) --- */
.dtmm-column-header {
    font-size: 22px;          
    font-weight: 800;         
    color: #6a4c89;           
    margin-bottom: 18px;      
    padding-bottom: 10px;     
    border-bottom: 2px solid #f1f1f1; /* The division line */
    letter-spacing: -0.5px;   
    line-height: 1.2;
    display: block;
    
    /* NEW: Force alignment even if empty */
    min-height: 40px; 
    box-sizing: border-box;
}

/* Ensure the border shows even if there is no text inside */
.dtmm-column-header:empty::before {
    content: "\00a0"; /* Invisible space to keep the height active */
}

/* --- 11. Mega Menu Footer Utility Bar (Centered Layout) --- */
.dtmm-menu-footer {
    flex: 1 0 100% !important; /* Makes footer span 100% width */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 50px !important;
    padding: 25px 0 !important;
    background: #fcfcfc !important;
    border-top: 1px solid #f1f1f1 !important;
    
    /* Pull the footer to the very bottom edges */
    margin: 30px -1.5rem -1.5rem -1.5rem !important; 
    border-radius: 0 0 12px 12px;
}

.dtmm-footer-item {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    flex: 0 1 auto;
}

.dtmm-footer-icon {
    width: 50px !important;
    height: 50px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
}

.dtmm-footer-label {
    font-weight: 700 !important;
    font-size: 1rem !important;
    color: #6a4c89 !important; /* Your Brand Purple */
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.dtmm-footer-item:hover .dtmm-footer-label {
    color: #a987c2 !important;
    text-decoration: underline !important;
}
/* Flag Alignment in Menu */
.my-menu-top-level > li > a .fi {
    margin-right: 8px; /* Spacing between flag and text */
    border-radius: 2px; /* Slight rounding for a modern look */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    vertical-align: middle;
    display: inline-block;
}

/* Ensure the text doesn't look cramped */
.my-menu-top-level > li > a {
    display: flex;
    align-items: center;
}