/* =========================================
   STYLEBRAND.CSS
   Brand Page Controller (Apriori, Maestro, etc.)
   ========================================= */

/* --- 1. LOADING SCREEN --- */
#loading-screen {
    position: fixed; 
    inset: 0; 
    background: #fff; 
    z-index: 99999;
    display: flex; 
    justify-content: center; 
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading-screen.hidden { 
    opacity: 0; 
    visibility: hidden; 
    pointer-events: none; 
}

.loader-content { 
    display: flex; 
    gap: 5px; 
}

/* --- 2. PAGE LAYOUT & BANNER --- */
.brand-header-banner {
    position: relative; 
    width: 100%; 
    
    /* YOUR ORIGINAL HEIGHT SETTINGS PRESERVED */
    height: clamp(400px, 60vh, 500px); 
    
    overflow: hidden; 
    margin-top: 0; 
    
    /* FIX 1: This base color acts as the "tint" when image opacity is lowered */
    background-color: #000000; 
    z-index: 1;
}

.banner-img { 
    position: absolute;
    inset: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    
    /* Positions the image based on your HTML offset */
    object-position: center var(--banner-offset, 50%); 
    
    /* YOUR ORIGINAL SCALE PRESERVED */
    transform: scale(1.2); 
    
    /* FIX 2: Instead of brightness (which can look washed out), we use 
       opacity to let the 'background-color: #000000' of the container bleed through. 
       Lower this value to make it DARKER.
    */
    opacity: 0.6; 

    /* FIX 3: Ensures the image sits BEHIND the overlay */
    z-index: 1;
    
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.banner-overlay {
    position: absolute; 
    inset: 0; 
    
    /* FIX 4: A more aggressive gradient. 
       The '0.8' at the end is the darkness at the bottom. 
       Increase '0.3' to make the top darker.
    */
    background: linear-gradient(
        to bottom, 
        rgba(0, 0, 0, 0.1) 0%, 
        rgba(0, 0, 0, 0.0) 100%
    );
    
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    color: white; 
    text-align: center; 
    
    /* FIX 5: Ensures the dark gradient is ON TOP of the image */
    z-index: 2; 
    padding: 20px; 
}

/* --- THE MOBILE FIX --- */
@media (max-width: 1024px) {
    .banner-img {
        object-position: center center !important; 
        transform: scale(1) !important; 
    }
}

/* --- 3. SMART GRID (Desktop Default) --- */
.catalogue-section { 
    padding-top: 40px; 
    padding-bottom: 100px; 
    background: #fff; 
    width: 100%; 
}

.menu-catalogue {
    display: grid; 
    grid-template-columns: repeat(4, 1fr); /* Default 4 columns */
    gap: 30px;
    width: 100%; 
    max-width: 1600px; 
    margin: 0 auto; 
    padding: 0 20px;
}


/* --- 4. CATEGORY SEPARATORS (Black & Normal Spacing) --- */
.category-separator {
    display: flex; 
    align-items: center; 
    justify-content: center;
    width: 100%; 
    max-width: 1400px; 
    margin: 80px auto 40px auto; 
    padding: 0 20px;
    opacity: 0; 
    transform: translateY(20px); 
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.category-separator.visible { 
    opacity: 1; 
    transform: translateY(0); 
}

.category-separator::before, 
.category-separator::after {
    content: ''; 
    flex: 1; 
    height: 1px; 
    background-color: #ddd; 
    margin: 0 30px;
}

.category-title {
    font-family: 'Onest', sans-serif; 
    font-size: 2rem; 
    font-weight: 650; 
    color: #111; /* Black */
    text-transform: capitalize; 
    letter-spacing: 1px; /* Normal spacing */
    text-align: center; 
    white-space: nowrap;
}


/* --- 5. PRODUCT CARD STYLES (Bigger Images) --- */
.menu-item {
    display: flex; 
    flex-direction: column; 
    align-items: center;
    position: relative; 
    cursor: pointer; 
    margin-bottom: 30px; 
    width: 100%;
    height: 100%; /* This forces all boxes in the row to be the same height */
}

.menu-img-container {
    width: 100%; 
    height: 280px; /* Reduced height to make room for text */
    position: relative; 
    z-index: 10; 
    /* REMOVED: margin-bottom: -60px; (This was causing the clipping!) */
    display: flex; 
    justify-content: center; 
    align-items: center; 
    padding: 20px;
}

.menu-img {
    height: 100%; 
    width: auto; 
    max-width: 100%; 
    object-fit: contain;
    /* filter: drop-shadow(0 15px 30px rgba(0,0,0,0.2));  */
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    transform: scale(1.05); /* Slightly larger default */
}

.menu-item:hover .menu-img { 
    transform: scale(1.15) translateY(-10px); 
}

.menu-info-box {
    width: 100%; 
    background: #fff; 
    border-radius: 2px;
    padding: 20px;
    position: relative; 
    z-index: 5; 
    text-align: center; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    flex-grow: 1; /* Pushes the 'View Details' button safely to the bottom */
    
    /* BORDER & SHADOWS */
    border: 1px solid #eee; 
   /* box-shadow: 0 10px 30px rgba(0,0,0,0.05); */
    transition: all 0.4s ease; 
}

.menu-item:hover .menu-info-box { 
    border-color: #00284A;
   /* box-shadow: 0 20px 40px rgba(0, 40, 74, 0.15); */
}

/* Typography inside card */
.brand-label { 
    font-size: 0.7rem; 
    color: #00284A; 
    font-weight: 700; 
    text-transform: uppercase; 
    margin-bottom: 5px; 
    display: block; 
}

.menu-header h3 { 
    font-family: 'Onest', sans-serif;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem); /* Smart scaling for long names */
    color: #000; 
    margin: 0 0 10px 0; 
    font-weight: 500; 
    line-height: 1.3;
    white-space: normal; /* Lets long text wrap cleanly */
    word-wrap: break-word; 
    height: auto; /* Removes any fixed height */
    overflow: visible; /* Stops the text from being clipped */
}

.menu-tag { 
    font-size: 0.75rem; 
    color: #999; 
    text-transform: uppercase; 
    margin-bottom: 15px; 
    display: block; 
}

.menu-desc { 
    font-size: 0.85rem; 
    color: #444; 
    line-height: 1.4; 
    margin-bottom: 20px; 
}

.menu-btn {
    background-color: #04233f;
    color: #fff;
    padding: 12px 20px; 
    border-radius: 2px;
    font-size: 0.8rem; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    border: none; 
    border-radius: 2px; 
    cursor: pointer; 
    width: 80%; 
    max-width: 250px; 
    text-align: center; 
    
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    
    margin: 0 auto; /* Centers the button */
}

.menu-btn:hover { 
    background-color: #001b33;
    transform: translateY(-3px);
  /*  box-shadow: 0 8px 20px rgba(0, 40, 74, 0.25); */
}

.menu-item:hover .menu-btn { 
    background: #00284A; 
    color: white; 
}


/* --- 6. ANIMATIONS (Fixed) --- */
.product-entry-anim {
    opacity: 0; 
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out; 
}

/* Added by JS IntersectionObserver */
.product-entry-anim.visible, 
.fade-up.visible {
    opacity: 1; 
    transform: translateY(0);
}


/* =========================================
   7. MODAL STYLES
   ========================================= */
.modal-overlay { 
    position: fixed !important; 
    inset: 0; 
    z-index: 200000 !important; 
    background: rgba(0, 0, 0, 0.9); 
    backdrop-filter: blur(10px); 
    display: flex !important; 
    justify-content: center; 
    align-items: center; 
    
    opacity: 0; 
    visibility: hidden; 
    pointer-events: none; 
    transition: all 0.4s ease; 
    padding: 20px;
}

.modal-overlay.active { 
    opacity: 1; 
    visibility: visible !important; 
    pointer-events: auto !important; 
}

.modal-content.new-design { 
    max-width: 1000px; 
    width: 95%; 
    padding: 0; 
    border-radius: 0; 
    overflow: hidden; 
    background: #fff; 
    position: relative; 
   /*  box-shadow: 0 30px 60px rgba(0,0,0,0.5); */
    transform: scale(0.9); 
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); 
    display: flex; 
    flex-direction: row; 
}

.modal-overlay.active .modal-content.new-design { 
    transform: scale(1); 
}

.modal-body-flex { 
    display: flex; 
    flex-direction: row; 
    width: 100%; 
    min-height: 500px; 
}

.modal-col-left { 
    flex: 1.2; 
    background-color: #fff; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 20px; 
}

.modal-big-image { 
    width: 100%; 
    height: auto; 
    max-height: 80vh; 
    object-fit: contain; 
   /*  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.15)); */
    
    /* THE MANUAL SCALE FACTOR: 1.35 = 35% larger */
    transform: scale(1.35) !important; 
    
    transform-origin: center center; 
}

.modal-col-right { 
    flex: 1; 
    padding: 50px 40px; 
    display: flex; 
    flex-direction: column; 
    text-align: left; 
    position: relative; 
}

.modal-close-btn { 
    position: absolute; 
    top: 20px; 
    right: 20px; 
    font-size: 2rem; 
    color: #000; 
    cursor: pointer; 
    z-index: 200010; 
    line-height: 1; 
    background: none; 
    border: none; 
    transition: color 0.3s ease;
}

.modal-close-btn:hover { color: #011f3a; }

.modal-title { 
    font-family: 'Onest', sans-serif; 
    font-size: 2.2rem; 
    font-weight: 500 !important; 
    color: #000; 
    margin-bottom: 5px; 
    line-height: 1.2; 
}

.modal-subtitle { 
    font-family: 'Onest', sans-serif; 
    font-size: 1rem; 
    font-weight: 700; 
    color: #00284A; 
    margin-bottom: 25px; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
}

.modal-medals-container { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 25px; }
.modal-medal-icon { height: 50px; width: auto; }

.specs-container { 
    display: flex; flex-direction: column; gap: 10px; 
    margin-bottom: 25px; border-top: 1px solid #eee; padding-top: 20px; 
}
.spec-row { 
    display: flex; justify-content: space-between; 
    border-bottom: 1px solid #f9f9f9; padding-bottom: 8px; 
}
.spec-label { font-weight: 700; color: #111; font-size: 0.9rem; }
.spec-value { font-weight: 400; color: #555; font-size: 0.9rem; text-align: right; }
.modal-description { font-size: 0.95rem; color: #555; line-height: 1.6; }


/* =========================================
   8. RESPONSIVE LOGIC (SMART SCALING)
   ========================================= */

/* Tablet (Portrait) & Small Laptops: 2 Columns */
@media (max-width: 1024px) {
    .menu-catalogue { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 20px; 
    }
}

/* Mobile: Force 2 Columns + Adjustments */
@media (max-width: 600px) {
    .menu-catalogue { 
        grid-template-columns: repeat(2, 1fr); /* FORCE 2 COLUMNS */
        gap: 10px; 
        padding: 0 10px;
    }
    
    .menu-img-container { 
        height: 200px; 
        margin-bottom: -30px; 
    }
    
    .menu-info-box { 
        padding: 40px 10px 20px 10px; 
        min-height: 220px; 
    }
    
    .menu-header h3 { 
        font-size: 0.95rem; 
        line-height: 1.2; 
        margin-bottom: 5px; 
    }
    
    .brand-label { font-size: 0.6rem; }
    .menu-tag { font-size: 0.65rem; margin-bottom: 8px; }
    
    .menu-btn { 
        padding: 8px 0; 
        width: 100%; 
        font-size: 0.7rem; 
    }
    
    .category-title { 
        font-size: 1.5rem; 
        letter-spacing: 0; 
    }
    
    .category-separator { 
        margin: 50px auto 30px auto; 
    }
    .category-separator::before, 
    .category-separator::after { margin: 0 15px; }
    
    .banner-title { font-size: 2.5rem; }
    
    /* Responsive Modal */
    .modal-content.new-design { 
        height: 100%; 
        max-height: 100vh;
        flex-direction: column; 
        overflow-y: auto; 
    }
    .modal-body-flex { flex-direction: column; }
    .modal-col-left { padding: 40px; min-height: 300px; }
    .modal-big-image { 
        max-height: 300px; 
        
        /* A slightly smaller scale factor for phones so it doesn't block the text below it */
        transform: scale(1.25) !important; 
    }
    .modal-col-right { padding: 30px; }
}


/* =========================================
   9. HAMBURGER BUTTON
   ========================================= */
.hamburger-btn {
    display: none; 
    background: none; 
    border: none; 
    cursor: pointer; 
    color: #000; 
    padding: 5px; 
    z-index: 2001;
}

@media (max-width: 968px) {
    .desktop-only { display: none !important; }
    .hamburger-btn { display: block; }
}

/* =========================================
   10. DROP DOWN FILTERS
   ========================================= */
.filter-bar-container {
    width: 100%; 
    max-width: 1600px; 
    margin: 0 auto 20px auto; 
    padding: 0 20px;
    display: flex;
    gap: 20px;
    justify-content: flex-start;
    position: relative;
    z-index: 100; /* Keeps dropdowns above the grid */
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 280px; /* Fixed width for premium feel */
    position: relative;
}

.filter-group label {
    font-family: 'Onest', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #999;
    font-weight: 700;
}

/* The Trigger Button */
.dropdown-btn {
    width: 100%;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 14px 20px;
    font-family: 'Onest', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #00284A;
    cursor: pointer;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
   /* box-shadow: 0 2px 10px rgba(0,0,0,0.02); */
}

.dropdown-btn:hover, .custom-dropdown.open .dropdown-btn {
    border-color: #00284A;
   /* box-shadow: 0 5px 15px rgba(0, 40, 74, 0.08); */
}

/* The Arrow Icon */
.dropdown-btn::after {
    content: '';
    width: 10px;
    height: 6px;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2300284A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    transition: transform 0.3s ease;
}

.custom-dropdown.open .dropdown-btn::after {
    transform: rotate(180deg);
}

/* The Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
   /* box-shadow: 0 15px 35px rgba(0,0,0,0.1); */
    list-style: none;
    padding: 5px 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
    
    /* Animation defaults */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Custom Scrollbar for the menu */
.dropdown-menu::-webkit-scrollbar { width: 6px; }
.dropdown-menu::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px;}
.dropdown-menu::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px;}
.dropdown-menu::-webkit-scrollbar-thumb:hover { background: #00284A; }

/* Menu Items */
.dropdown-menu li {
    padding: 12px 20px;
    font-family: 'Onest', sans-serif;
    font-size: 0.85rem;
    color: #444;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.dropdown-menu li:hover {
    background: #f9f9f9;
    color: #00284A;
}

.dropdown-menu li.active {
    background: #00284A;
    color: #fff;
    font-weight: 700;
}

.no-results-box {
    text-align: center;
    padding: 80px 20px;
    width: 100%;
}

.no-results-box h3 {
    font-family: 'Onest', sans-serif;
    color: #00284A;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

/* --- MOBILE ADJUSTMENTS FOR FILTERS (Side-by-Side) --- */
@media (max-width: 600px) {
    .filter-bar-container { 
        flex-direction: row; /* Forces them onto the same line */
        gap: 10px; /* Reduces the gap to save space */
        padding: 0 10px;
    }
    
    .filter-group { 
        flex: 1; /* Makes them share the width equally 50/50 */
        width: 50%;
        min-width: 0; /* Overrides the 280px desktop width safely */
    }

    .filter-group label {
        font-size: 0.65rem; 
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; /* Adds ... if label is too long */
    }

    /* Adjust the trigger button for small screens */
    .dropdown-btn { 
        padding: 12px 10px; 
        font-size: 0.75rem; 
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; /* Adds ... to long selected values */
    }

    /* Stop the arrow icon from squishing */
    .dropdown-btn::after {
        flex-shrink: 0;
        margin-left: 5px;
    }

    /* Make the dropdown menus wide enough to read the options */
    .dropdown-menu {
        width: max-content; 
        min-width: 160px; /* Ensures it's wide enough to read */
        max-width: 90vw; /* Prevents it from being wider than the phone */
    }

    /* IMPORTANT: The right-side (Tags) menu must align to the right edge 
       so it doesn't bleed off the right side of the screen! */
    .filter-group:nth-child(2) .dropdown-menu {
        left: auto;
        right: 0;
    }
    
    .dropdown-menu li {
        font-size: 0.8rem;
        padding: 10px 15px;
    }
}