/*
 * Navigation Styles for GsmPlus Theme
 * File: assets/css/navigation.css
 * Minimal Full-Width Dropdowns - No JavaScript Required
 */

/* ==========================================================================
   Enhanced Header & Navigation Styles with Dropdown
   ========================================================================== */

.site-header {
    background: var(--color-white);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Top Navigation */
.top-navigation {
    background: var(--color-white);
    padding: 0 2rem;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.site-branding {
    display: flex;
    flex-shrink: 0;
    gap: .5rem;
    text-align: left;
    align-items: center;
}

.site-logo a {
    text-decoration: none;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    font-family: var(--font-family-primary);
    letter-spacing: -0.02em;
}

.logo-gsm {
    color: var(--color-primary);
}

.logo-plus {
    color: var(--color-secondary);
}

.logo-symbol {
    color: var(--color-secondary);
}

/* Search Container */
.search-container-mobile {
    display: none;
}

.search-container {
    flex: 1;
    max-width: 28rem;
    margin: 0 2rem;
}

.search-form {
    position: relative;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    width: 100%;
}

.search-field {
    width: 100%;
    padding: 0.5rem 3rem 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-normal);
    background: var(--color-white);
    color: var(--color-text);
    transition: all 0.2s ease;
}

.search-field:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(31, 128, 119, 0.1);
}

.search-field::placeholder {
    color: var(--color-border);
}

.search-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--color-border);
    transition: color 0.2s ease;
}

.search-button:hover {
    color: var(--color-primary);
}

.search-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-medium);
    transition: color 0.2s ease;
}

.header-link:hover {
    color: var(--color-primary);
}

.header-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-border);
    transition: color 0.2s ease;
}

.header-link:hover .header-icon {
    color: var(--color-primary);
}

.header-text {
    white-space: nowrap;
}

.cart-count {
    background: var(--color-secondary);
    color: var(--color-white);
    font-size: 0.75rem;
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-semibold);
    padding: 0.125rem 0.375rem;
    border-radius: 0.375rem;
    min-width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.25rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 0.25rem;
}

.hamburger-line {
    width: 1.2rem;
    height: 2px;
    background: var(--color-border);
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover .hamburger-line {
    background: var(--color-primary);
}

/* ==========================================================================
   Category Navigation with Full-Width Dropdowns
   ========================================================================== */

.category-navigation {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: relative;
    overflow: visible;
    padding: 0 2rem;
}

.category-menu-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.category-icon--list {
    display: inline-block;
    width: 1rem;
    height: 1rem;
}

.category-menu {
    display: flex;
    list-style: none;
    width: 100%;
    justify-content: space-between;
    margin: 0;
    padding: 0;
}

.menu-item a {
    display: flex;
    align-items: center;
    color: var(--color-text);
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.875rem;
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-medium);
    padding: 1rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.menu-item a:hover {
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-primary);
}

/* ==========================================================================
   Full-Width Dropdown Styles - FIXED POSITIONING
   ========================================================================== */

/* Overlay for dropdown menus */
.dropdown-overlay {
    position: fixed;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(31, 128, 119, 0.2); /* 20% opacity of --color-primary */
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.menu-item:hover .dropdown-overlay {
    opacity: 1;
    visibility: visible;
}

.menu-item .dropdown-menu {
    display: none;
    justify-content: center;
    position: absolute;
    left: 0;
    width: 100%;
    background: var(--color-white);
    transition: all 0.3s ease;
    z-index: 999;
    padding: 2rem 0;
    top: 100%; 
    border-top: 1px solid var(--color-border);
}

/* Inner container for dropdown content */
.dropdown-menu .dropdown-container {
    max-width: 1140px;
    width: 100%;
}

/* CSS-only hover behavior */
.menu-item:hover .dropdown-menu {
    display: flex;
}

.menu-item:hover > a,
.menu-item:focus-within > a {
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-primary);
}

/* Dropdown Header */
.dropdown-menu .dropdown-header {
    background: var(--color-primary);
    padding: 1.5rem 0;
    color: var(--color-white);
}

.dropdown-menu .dropdown-header h2 {
    color: var(--color-white);
    font-size: 1.5rem;
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-bold);
    margin: 0;
}

/* Enhanced Dropdown Grid Layout for Full Width */
.dropdown-menu .dropdown-grid {
    display: flex;
    gap: 1rem;
    padding: 0;
    margin: 0;
    list-style: none;
    align-items: flex-start;
}

.dropdown-menu .dropdown-column {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.chargers-left-col {
    width: 50%;
    display: flex;
    gap: 1rem;
}

/* Column Header with Icons - NEW STYLES */
.dropdown-menu .column-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--color-background);
    padding: 1rem;
    border-radius: 0.5rem;
}

.dropdown-menu .column-icon {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    background-color: var(--color-white);
    padding: 0.5rem;
    border-radius: .5rem;
}

.dropdown-menu .column-header .column-title {
    margin: 0;
    padding: 0;
    border: none;
    font-weight: var(--font-weight-semibold);
    font-size: 0.875rem;
}

.column-header:hover h3 {
    color: var(--color-primary);
}

.dropdown-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.625rem 1.25rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-normal);
    border: none;
    border-bottom: none;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.dropdown-menu a:hover {
    text-decoration: underline;
    border: none;
}

.dropdown-menu a:hover h3 {
    color: var(--color-primary);
}

/* Special styling for "View All" items */
.dropdown-menu .view-all-item {
    border-top: 1px solid var(--color-border);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.dropdown-menu .view-all-item a {
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
    padding: 0.75rem 1.25rem;
}

.dropdown-menu .view-all-item a:hover {
    background: var(--color-primary);
    color: var(--color-white);
    padding-left: 1.25rem;
}

.dropdown-menu .brand-cards-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 50%;
}

.dropdown-menu .brand-card {
    background: var(--color-background, #f8f9fa);
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
}

.dropdown-menu .brand-card-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.dropdown-menu .brand-card-icon {
    aspect-ratio: 1;
    display: flex;
    width: 7rem;
    align-items: center;
    justify-content: center;
    background-color: var(--color-white);
    border-radius: 0.375rem;
    padding: 0.5rem;
}

.dropdown-menu .brand-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dropdown-menu .brand-card-text {
    flex: 1;
}

.dropdown-menu .brand-card-link {
    display: flex;
    align-items: center;
    color: var(--color-text);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    font-size: 0.875rem;
    padding: 0;
}

span.brand-card-arrow {
    display: flex;
}

.dropdown-column.latest-arrivals-column {
    flex-direction: row;
    justify-content: space-between;
    background-color: var(--color-background);
    padding: 1rem;
    border-radius: 0.5rem;
}

.latest-arrivals-image {
    width: 15rem;
    height: 15rem;
    padding: 1rem;
    background-color: white;
    border-radius: 0.375rem;
}

img.watch-image {
    width: 100%;
}

.latest-arrivals-text-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

a.latest-arrivals-button {
    background-color: var(--color-primary);
    border-radius: 0.375rem;
    color: var(--color-white);
    text-align: center;
    font-weight: var(--font-weight-semibold);
}

a.latest-arrivals-button:hover {
    color: var(--color-white);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    background-color: var(--color-primary-dark);
}

/* ==========================================================================
   Cases Dropdown Grid Layout - Updated
   ========================================================================== */

.dropdown-grid.cases-mega {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 1rem;
    padding: 0;
    margin: 0;
    align-items: flex-start;
}

/* Brand selector section - spans 2 columns */
.dropdown-column.cases-left-rail {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Cases models section - spans 6 columns */
.dropdown-column.cases-models-grid {
    grid-column: span 6;
}

/* Individual case columns within the models grid */
.cases-columns {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    width: 100%;
}

.cases-col {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

/* Brand card styling for cases */
.brand-card--cases {
    background: var(--color-background, #f8f9fa);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.brand-card--cases .brand-card-content {
    display: flex;
    align-items: center;
    padding: 0;
}

.brand-card--cases .brand-card-icon {
    width: 4rem;
    height: 4rem;
    background-color: var(--color-white);
    border-radius: 0.375rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-card--cases .brand-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-card--cases .brand-card-text {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-card--cases .brand-card-title {
    font-weight: var(--font-weight-semibold);
    font-size: 0.875rem;
    color: var(--color-text);
}

.brand-card--cases .brand-card-arrow {
    color: var(--color-text);
}

/* Cases variants list */
.cases-variants {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cases-variants li {
    margin: 0;
}

.cases-variants a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0;
}

.cases-models-grid .column-header {
    display: block;
    padding: 0 0 .5rem 0;
    border-radius: 0;
    background-color: transparent;
    border-bottom: 1px solid var(--color-border);
}

.cases-col .column-header:hover {
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
}

/* ==========================================================================
   Brand Toggle Functionality for Cases Dropdown
   ========================================================================== */

/* Brand content visibility - only show active brand by default */
.brand-content {
    display: none;
}

.brand-content.active {
    display: contents; /* Use contents to make children participate in parent grid */
    width: 100%;
}

.brand-card--cases.active .brand-card-title {
    color: var(--color-primary) !important;
}

.brand-card--cases.active .brand-card-arrow {
    color: var(--color-primary) !important;
}

/* Smooth transitions for brand switching */
.brand-content {
    transition: all 0.3s ease;
}

.brand-card--cases {
    transition: all 0.2s ease;
}

/* Ensure proper layout for cases columns */
.cases-columns .brand-content {
    width: 100%;
}

/* Override grid layout when brand content is active to use the parent's grid */
.cases-columns .brand-content.active {
    display: contents;
}

/* Additional hover effects for better UX */
.brand-card--cases:hover {
    cursor: pointer;
}

/* Additional hover effects for better UX */
.brand-card--cases:hover a {
    text-decoration: underline;
}

/* ==========================================================================
   Mobile Menu Styles (768px and below)
   ========================================================================== */

@media (max-width: 1280px) {
    /* Top Navigation Mobile Layout */

    .nav-wrapper {
        padding: 1rem 0;
        gap: 1rem;
        flex-wrap: wrap;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
        order: -1; /* Place burger menu first */
    }

    .logo-text {
        font-size: 1.5rem;
    }

    /* Header Actions - right side */
    .header-actions {
        order: 1;
        gap: 1rem;
        flex-shrink: 0;
    }

    /* Move search below header */
    .search-container {
        display: none;
    }

    /* Category Navigation Mobile Styles */
    .category-navigation {
        display: none;
    }

    .category-menu-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    /* Hide category menu by default on mobile */
    .category-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 0;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }

    /* Show menu when active */
    .category-menu.active {
        display: flex;
    }

    /* Mobile menu items */
    .menu-item {
        border-bottom: 1px solid var(--color-border);
    }

    .menu-item a {
        padding: 1rem;
        border-bottom: none;
        font-size: 1rem;
    }

    .menu-item a:hover {
        background: var(--color-background);
        border-bottom: none;
    }

    /* Disable dropdowns on mobile */
    .menu-item .dropdown-menu,
    .dropdown-overlay {
        display: none !important;
    }
    
    .search-container-mobile {
        display: flex;
        padding: 0 2rem 1rem;
    }
}


@media (max-width: 768px) {  
    .header-link.orders-link {
        display: none;
    }

    .top-navigation {
        padding: 0 1rem;
    }

    .search-container-mobile {
        padding: 0 1rem 1rem;
    }
}


/* ==========================================================================
   Mobile Overlay Side Menu Styles
   ========================================================================== */

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-side-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 400px;
    height: 100%;
    background: var(--color-white);
    z-index: 1000;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-side-menu.active {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-white);
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mobile-menu-close:hover {
    color: var(--color-primary);
}

.mobile-menu-content {
    padding: 0;
}

.mobile-menu-content .category-menu {
    display: flex !important;
    flex-direction: column;
}

.mobile-menu-content .menu-item {
    border-bottom: 1px solid var(--color-border);
}

.mobile-menu-content .menu-item a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s ease;
}

.mobile-menu-content .menu-item a:hover {
    background: var(--color-background);
}

/* Keep burger icon visible (no cross animation) */
.mobile-menu-toggle:hover .hamburger-line {
    background: var(--color-primary);
}