/* Navigation */

@media (min-width: 768px) {
    .nav-header {
        position: sticky;
        top: 0;
        z-index: 100;
    }
}

.nav-header {
    position: relative;
    width: 100%;
    height: 90px;
    /* Explicit height to match subnav offset */
    z-index: 100;
    background-color: #000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
    position: relative;
}

/* Official Logo Style - Premium & Bold */
.minietech-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.minietech-logo:hover {
    opacity: 0.8;
}

/* .minietech-logo img {
    border-radius: 15px;

} */

.official-logo {
    height: 70px;
    /* Increased to 80px as requested */
    width: auto;
    display: block;
    object-fit: contain;
}

@media (max-width: 767px) {
    .nav-content {
        height: 75px;
    }

    .official-logo {
        height: 60px;
    }
}

@media (max-width: 351px) {
    .nav-content>a {
        position: static;
        transform: none;
        margin-right: auto;
        margin-left: 10px;
    }

    .official-logo {
        height: 52px;
        /* Slightly smaller to fit tight spaces */
        margin-right: 25px;
    }
}

@keyframes slideDownCustom {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpCustom {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes iconPop {
    from {
        opacity: 0;
        transform: scale(0) rotate(-45deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* ========================
   MOBILE NAVBAR
   ======================== */

/* Hamburger: visible only on mobile */
.nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #fff;
    z-index: 25;
}

.nav-hamburger .material-symbols-outlined {
    font-size: 1.6rem;
}

/* On mobile: perfectly center the logo */
@media (max-width: 767px) {
    .nav-content>a {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        padding-left: 0;
        display: flex;
        align-items: center;
        text-decoration: none;
        z-index: 10;
    }

    .minietech-logo {
        padding-left: 0;
    }

    /* Hide account icon on mobile to avoid header clutter; moved to mobile menu */
    .nav-account-btn {
        display: none;
    }
}

/* Micro-adjustment for very small screens (320px - 400px) to optically center the logo */
@media (max-width: 400px) {
    .nav-content>a {
        padding-right: 14px;
        /* Counter-balance the hamburger vs right icons */
    }
}

/* ========================
   DESKTOP NAVBAR
   ======================== */
@media (min-width: 768px) {

    /* Hamburger hidden on desktop */
    .nav-hamburger {
        display: none;
    }

    /* Logo returns to normal flow on desktop */
    .logo {
        position: static;
        transform: none;
    }
}

/* Nav Links */
.nav-links {
    display: none;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

.nav-link {
    font-size: 0.875rem;
    color: #fff;
}

.nav-link.active {
    color: #fff;
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 4px;
}

/* ========================
   DESKTOP MEGA DROPDOWN
   ======================== */

/* Wrapper positions the panel relative to the trigger */
.nav-dropdown-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

/* The Shop button trigger */
.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    color: #fff;
    font-size: 0.875rem;
    text-decoration: none;
}

.nav-dropdown-trigger:hover {
    color: #fff;
}

/* The chevron SVG rotates when open */
.nav-chevron {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.nav-dropdown-wrap.is-open .nav-chevron {
    transform: rotate(180deg);
}

/* The panel itself â€” floating left drawer */
.nav-dropdown-panel {
    position: fixed;
    top: calc(90px + 1rem);
    /* Float below navbar */
    left: 1rem;
    height: calc(100vh - 90px - 2rem);
    /* Float with margins */
    width: 380px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    /* 3D deep shadow */
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    /* Above the overlay */
    opacity: 0;
    transform: translateX(-120%);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
    overflow-y: auto;
}

/* The dark blurred overlay in the background */
.desktop-menu-overlay {
    position: fixed;
    top: 90px;
    /* Start below navbar so navbar stays white */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Open state â€” shown via JS adding `.is-open` directly to the elements */
.nav-dropdown-panel.is-open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.desktop-menu-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Hide entirely on mobile screens */
@media (max-width: 767px) {

    .nav-dropdown-panel,
    .desktop-menu-overlay {
        display: none !important;
    }
}

/* Close button inside panel */
.nav-panel-close {
    position: absolute;
    top: 2rem;
    left: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e5e5e5;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    transition: background 0.2s ease;
    z-index: 5;
    padding: 0;
}

.nav-panel-close:hover {
    background: #f4f4f5;
}

/* Inner content */
.nav-dropdown-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-top: 5rem;
    /* Space for the close button above */
}

/* List reset */
.nav-panel-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: auto;
    /* Push featured image to bottom */
}

/* Link items */
.nav-panel-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 500;
    color: #1a1c1d;
    transition: opacity 0.2s ease;
    letter-spacing: -0.02em;
}

.nav-panel-link:hover {
    opacity: 0.6;
}

.nav-panel-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #e5e5ea;
    border-radius: 50%;
    color: #555;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-panel-link:hover .nav-panel-arrow {
    background: #111;
    color: #fff;
    transform: translateX(3px);
}

/* Featured product card at the bottom of the panel */
.nav-dropdown-feature {
    width: 100%;
    margin-top: 2rem;
}

.nav-feature-card {
    display: block;
    position: relative;
    border-radius: 8px;
    /* Slightly less rounded */
    overflow: hidden;
    text-decoration: none;
}

.nav-feature-img {
    width: 100%;
    height: 260px;
    /* Taller image */
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.nav-feature-card:hover .nav-feature-img {
    transform: scale(1.04);
}

.nav-feature-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1.2;
    font-weight: 800;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.nav-feature-arrows {
    display: flex;
    gap: 8px;
}

.arrow-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    color: #111;
}


.nav-utilities {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    z-index: 25;
    position: relative;
    flex: 1;
    /* Take equal space with logo to keep search centered */
    justify-content: flex-end;
}

/* ============================================================
   CENTERED SEARCH LAYOUT (GRID SYSTEM)
   ============================================================ */
@media (min-width: 768px) {
    .nav-content {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        height: 90px;
    }

    .logo-link {
        display: flex;
        justify-self: start;
        width: fit-content;
        z-index: 10;
    }

    .nav-search-container {
        display: flex;
        justify-content: center;
        width: 450px;
        /* Fixed width for search to ensure perfect center */
        margin: 0 !important;
        z-index: 10;
    }

    .nav-utilities {
        display: flex;
        justify-self: end;
        width: fit-content;
        z-index: 10;
    }

    .nav-search-bar {
        width: 100%;
    }
}

/* Nav Search Bar Styling */
.nav-search-bar {
    width: 100%;
    max-width: 450px;
    height: 42px;
    background: #f4f4f5;
    /* Light grey background from image */
    border-radius: 50px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    /* Increased padding since icon is gone */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-search-bar:hover {
    background: #ececef;
}

.nav-search-bar:focus-within {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.1);
}



.nav-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    color: #1a1c1d;
    font-weight: 500;
}

.nav-search-close {
    display: none;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
    margin-left: 0.5rem;
    transition: color 0.2s ease;
    align-items: center;
    justify-content: center;
}

.nav-search-close:hover {
    color: #1a1c1d;
}

.nav-search-close .material-symbols-outlined {
    font-size: 1.25rem;
}

.nav-search-bar.is-active .nav-search-close {
    display: flex;
}

.nav-search-bar input::placeholder {
    color: #8a8a8e;
    /* Placeholder color from image */
}

.nav-utilities button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.nav-utilities .mobile-search-btn {
    display: none;
}

@media (max-width: 1024px) {
    .nav-search-bar {
        max-width: 250px;
    }
}

@media (max-width: 767px) {
    .nav-search-container {
        display: none !important;
    }

    .nav-utilities .mobile-search-btn {
        display: flex !important;
    }

    .nav-account-btn,
    .nav-wishlist-btn {
        display: none !important;
    }

    .nav-utilities {
        flex: none;
    }
}

.nav-utilities button:hover {
    opacity: 0.7;
}



@media (max-width: 480px) {
    .nav-utilities {
        gap: 0.75rem;
        /* Tighter spacing for smaller mobile screens */
    }
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ========================
   MOBILE MENU BOTTOM SHEET
   ======================== */

/* Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 5000;
    /* Increased to stay above footer elements */
    opacity: 0;
    transition: opacity 0.35s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mobile-menu-overlay.is-open {
    display: block;
    opacity: 1;
}

/* Left Side Drawer */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: auto;
    width: 85vw;
    max-width: 400px;
    z-index: 5001;
    /* Above overlay and footer elements */
    background: #fff;
    border-radius: 0;
    padding: 0; /* Padding moved to panels for smooth edge-to-edge sliding */
    display: flex;
    flex-direction: column;
    gap: 0;
    transform: translateX(-100%);
    transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
    height: 100dvh;
    /* Dynamic viewport height */
    overflow: hidden; /* Hide scrollbar on the drawer, scroll inside panels */
}

/* Sliding Panels System */
.mobile-menu-wrapper {
    display: flex;
    width: 200%;
    height: 100%;
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
}

.mobile-menu-wrapper.show-submenu {
    transform: translateX(-50%);
}

.mobile-menu-panel {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 2.5rem 1.75rem 2.5rem;
    overflow-y: auto;
    flex-shrink: 0;
}

.mobile-menu-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1a1c1d;
    cursor: pointer;
    text-align: left;
    transition: opacity 0.2s ease;
    width: fit-content;
}

.mobile-menu-back:hover {
    opacity: 0.7;
}

.mobile-menu-back .material-symbols-outlined {
    font-size: 1.25rem;
    font-variation-settings: 'wght' 600;
}

.mobile-submenu-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1c1d;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.mobile-submenu-nav {
    display: flex;
    flex-direction: column;
}

.mobile-submenu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 0;
    border-bottom: 1px solid #f0f0f2;
    text-decoration: none;
    color: #1a1c1d;
    font-size: 1.1rem;
    font-weight: 500;
    transition: opacity 0.15s ease;
}

.mobile-submenu-item:last-child {
    border-bottom: none;
}

.mobile-submenu-item:hover {
    opacity: 0.6;
}

.mobile-submenu-item span:first-child {
    font-size: 1rem;
    font-weight: 500;
    color: #1a1c1d;
    letter-spacing: -0.02em;
}

.mobile-submenu-item .plus-icon {
    font-size: 1.25rem;
    font-weight: 400;
    color: #1a1c1d;
}

.mobile-menu-item .mobile-menu-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #e5e5ea;
    border-radius: 50%;
    color: #555;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.mobile-menu-item:active .mobile-menu-arrow {
    background: #111;
    color: #fff;
    transform: translateX(4px);
}

.mobile-menu.is-open {
    transform: translateX(0);
}

/* Close Button â€” Now inside the drawer */
.mobile-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f5f7;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s ease;
}

.mobile-menu-close:hover {
    background: #e5e5e7;
}

.mobile-menu-close .material-symbols-outlined {
    font-size: 1.4rem;
    color: #1a1c1d;
}

/* Nav Items */
.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    margin-bottom: auto;
    padding-top: 1.5rem;
    /* Increased clearance for (X) button */
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 0;
    border-bottom: 1px solid #f0f0f2;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.mobile-menu-item:last-child {
    border-bottom: none;
}

.mobile-menu-item:hover {
    opacity: 0.6;
}

.mobile-menu-label {
    font-size: 1rem;
    font-weight: 500;
    color: #1a1c1d;
    letter-spacing: -0.02em;
    line-height: 1;
}

.mobile-menu-arrow {
    font-size: 1.3rem;
    color: #1a1c1d;
    font-variation-settings: 'wght' 600;
}











/* Social Icons Row */
.mobile-menu-socials {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding-top: 2.5rem;
    margin-top: auto;
    border-top: 1px solid #f0f0f2;
}



.mobile-social-icons-row {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.mobile-social-icon {
    color: #1a1c1d;
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
}

.mobile-social-icon:active {
    opacity: 1;
    transform: scale(1.15);
}

/* Hide mobile menu on desktop */
@media (min-width: 768px) {

    .mobile-menu,
    .mobile-menu-overlay,
    .mobile-menu-close {
        display: none !important;
    }
}

/* ========================
   GLOBAL SEARCH MODAL
   ======================== */
.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 5100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.search-modal {
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 5101;
    opacity: 0;
    transform: translateY(-20px);
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.search-modal.is-open {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

@media (min-width: 830px) {
    .search-modal {
        top: 1rem;
        right: 1rem;
        left: auto;
        bottom: 1rem;
        width: 500px;
        max-width: calc(100vw - 2rem);
        height: calc(100vh - 2rem);
        border-radius: 12px;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
        /* Enhance 3D shadow */
        transform: translateX(120%);
    }

    .search-modal.is-open {
        transform: translateX(0);
    }
}

.search-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    box-sizing: border-box;
    width: 100%;
}

.search-modal-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: inherit;
    color: #8c8c8c;
    background: transparent;
    min-width: 0;
    width: 100%;
}

.search-modal-input::placeholder {
    color: #8c8c8c;
}

.search-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #1a1c1d;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 1rem;
}

.search-modal-close .material-symbols-outlined {
    font-weight: 600;
    font-size: 1.5rem;
}

.search-modal-body {
    padding: 1.5rem;
    box-sizing: border-box;
    width: 100%;
}

.popular-requests-title {
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 700;
    margin: 0 0 1.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.popular-requests-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.popular-chip {
    padding: 0.6rem 1.2rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.popular-chip:hover {
    background: #000;
    border-color: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}



/* ============================================================
   DESKTOP SUB-NAVBAR
   ============================================================ */

/* Only visible on desktop */
.desktop-subnav {
    display: none;
}

@media (min-width: 768px) {
    .subnav-sticky-wrap {
        display: block;
        position: sticky;
        top: 90px;
        /* immediately below the 90px nav-header */
        z-index: 90;
        /* below nav-header */
        clip-path: inset(0 -100vw -200vh -100vw);
        /* clips top so it doesn't bleed behind transparent nav-header, but allows mega menu dropdown */
        pointer-events: none;
        /* so wrapper doesn't block clicks */
    }

    .desktop-subnav {
        display: block;
        position: relative;
        z-index: 95;
        background: #fff;
        border-bottom: 1px solid rgba(0, 0, 0, 0.07);
        pointer-events: auto;
        /* restore clicks for actual subnav */
        transform: translateY(0);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        will-change: transform;
    }

    /* Scroll UP -> hide subnav */
    .desktop-subnav.subnav-hidden {
        transform: translateY(-100%);
    }
}

/* Inner layout: space-between, single row */
.desktop-subnav-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
}

/* â”€â”€ Left nav links â”€â”€ */
.subnav-links {
    display: flex;
    align-items: center;
    gap: 0;
}






.subnav-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    padding: 0 0.85rem;
    height: 36px;
    margin: 4px 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease, color 0.15s ease;
    white-space: nowrap;
    position: relative;
    cursor: pointer;
}

.subnav-link:hover {
    background-color: #f3f4f6;
    /* Light gray background on hover */
    color: #111;
}

/* Rolling Text Animation */
.roll-wrap {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    overflow: hidden;
    line-height: 1.2;
}

.roll-text {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.5, 0, 0.2, 1);
}

.roll-wrap::after {
    content: attr(data-text);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.5, 0, 0.2, 1);
}

.subnav-link:hover .roll-text {
    transform: translateY(-100%);
}

.subnav-link:hover .roll-wrap::after {
    transform: translateY(-100%);
}


/* FAQ link in red/accent */
.subnav-link-faq {
    color: #ef4444;
    font-weight: 600;
}

.subnav-link-faq:hover {
    color: #dc2626;
}

/* â”€â”€ Shop all trigger â”€â”€ */
.subnav-shop-wrap {
    position: static;
    /* mega positioned via fixed */
    display: flex;
    align-items: center;
    height: 44px;
}

.subnav-shop-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;

    padding: 0 0.85rem;
    /* Removed height override to inherit from .subnav-link */
    transition: color 0.15s ease;
}

.subnav-chevron {
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.subnav-shop-wrap.mega-open .subnav-chevron {
    transform: rotate(180deg);
}

/* â”€â”€ Right utilities â”€â”€ */
.subnav-utilities {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.subnav-util-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.subnav-util-link:hover {
    color: #111;
}

/* "Expert help" pill button */
.subnav-util-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #18181b;
    color: #fff;
    border: none;
    border-radius: 100px;
    padding: 7px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.15s ease;
}

.subnav-util-btn:hover {
    background: #000;
    transform: translateY(-1px);
}

/* ============================================================
   HORIZONTAL MEGA MENU DROPDOWN
   ============================================================ */

/* The full-width panel, drops down from the sub-navbar */
.subnav-mega-menu {
    position: absolute;
    top: 100%;
    /* Directly below the sticky wrapper */
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
    z-index: 89;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.subnav-mega-menu.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

/* Also adjust when subnav is hidden (shouldn't show, but safety) */
.desktop-subnav.subnav-hidden~.subnav-mega-overlay,
.desktop-subnav.subnav-hidden+* .subnav-mega-menu {
    position: absolute;
    top: 100%;
    /* Directly below the sticky wrapper */
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
    z-index: 89;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

/* Inner row: max-width container, flex columns */
.subnav-mega-inner {
    display: flex;
    align-items: flex-start;
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Each column with staggered reveal animation */
.mega-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 1rem;
    border-right: 1px solid #f3f4f6;

    /* Animation initial state */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.subnav-mega-menu.is-open .mega-col {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for a right-to-left effect */
.subnav-mega-menu.is-open .mega-col:nth-child(1) {
    transition-delay: 0.3s;
}

.subnav-mega-menu.is-open .mega-col:nth-child(2) {
    transition-delay: 0.25s;
}

.subnav-mega-menu.is-open .mega-col:nth-child(3) {
    transition-delay: 0.2s;
}

.subnav-mega-menu.is-open .mega-col:nth-child(4) {
    transition-delay: 0.15s;
}

.subnav-mega-menu.is-open .mega-col:nth-child(5) {
    transition-delay: 0.1s;
}

.mega-col:first-child {
    padding-left: 0;
}

.mega-col:last-child {
    border-right: none;
}

/* Category heading inside mega */
.mega-col-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
    text-transform: none;
    letter-spacing: 0;
    margin: 0 0 0.6rem 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Category links */
.mega-link {
    font-size: 0.8125rem;
    color: #6b7280;
    text-decoration: none;
    line-height: 1;
    padding: 5px 0;
    transition: color 0.15s ease;
    display: block;
}

.mega-link:hover {
    color: #111;
}

/* Badge chips (New releases, 20% OFF) */
.mega-badge {
    display: inline-block;
    border-radius: 100px;
    padding: 2px 7px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.4;
}

.mega-badge-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.mega-badge-orange {
    background: #fef3c7;
    color: #b45309;
}

/* Featured image column */
.mega-col-image {
    flex: 0 0 220px;
    padding-right: 0;
    border-right: none;
}

.mega-featured-card {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    text-decoration: none;
}

.mega-featured-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.mega-featured-card:hover .mega-featured-img {
    transform: scale(1.05);
}

.mega-featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.9rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
    color: #fff;
}

.mega-featured-badge {
    display: inline-block;
    background: #facc15;
    color: #111;
    font-size: 0.6rem;
    font-weight: 800;
    border-radius: 4px;
    padding: 2px 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.mega-featured-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2px;
    color: #fff;
}

.mega-featured-sub {
    margin: 0;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.3;
}

/* â”€â”€ Mega overlay (dim page behind) â”€â”€ */
.subnav-mega-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 100vh;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 88;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.subnav-mega-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Hide all mega-menu elements on mobile */
@media (max-width: 767px) {

    .desktop-subnav,
    .subnav-mega-menu,
    .subnav-mega-overlay {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 100vh;
        background: rgba(0, 0, 0, 0.25);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 88;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }
}

/* ============================================================
   DESKTOP SEARCH DROPDOWN (MEGA MENU STYLE)
   ============================================================ */

.desktop-search-dropdown {
    position: fixed;
    top: 90px;
    /* Directly below the primary navbar */
    left: 0;
    right: 0;
    background: #fff;
    z-index: 999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 3rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.desktop-search-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-dropdown-content {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 4rem;
}

/* Left Side: Popular Products */
.search-dropdown-left {
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    padding-right: 2rem;
}

.search-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.search-dropdown-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1c1d;
}

.dropdown-slider-arrows {
    display: flex;
    gap: 8px;
}

.dropdown-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #e2e2e4;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-arrow:hover {
    background: #f4f4f5;
    border-color: #1a1c1d;
}

.dropdown-arrow .material-symbols-outlined {
    font-size: 1.1rem;
    color: #1a1c1d;
}

.popular-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.popular-products-grid .bs-card {
    width: 100% !important;
    min-width: unset !important;
    flex-shrink: 1;
    border: 1px solid #f0f0f2;
    transition: all 0.3s ease;
}

.popular-products-grid .bs-card:hover {
    border-color: transparent;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.popular-products-grid .bs-card-img-wrap {
    background: #f8f8f8;
}

.popular-products-grid .bs-card-name {
    font-size: 0.85rem;
    height: 2.6em;
}

/* Right Side: Recently Viewed & Trending */
.search-dropdown-right {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1c1d;
}

.clear-recent {
    font-size: 0.75rem;
    color: #666;
    background: #f4f4f5;
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
}

.recent-thumbs {
    display: flex;
    gap: 12px;
}

.recent-thumbs img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #f8f8f8;
    padding: 4px;
    object-fit: contain;
    border: 1px solid #eee;
}

.trending-list {
    list-style: none;
}

.trending-list li {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #111;
    font-weight: 500;
    padding: 8px 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.trending-list li:hover {
    color: #4a6fff;
}

.trending-list li .material-symbols-outlined {
    font-size: 1.1rem;
    color: #999;
    margin-right: 10px;
}

/* Overlay for Search Dropdown */
.search-dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-dropdown-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Responsive: Hide desktop dropdown on mobile */
@media (max-width: 767px) {

    .desktop-search-dropdown,
    .search-dropdown-overlay {
        display: none !important;
    }
}