/* Main Design Tokens & Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Quicksand:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette (Kyari Inspired) */
    --primary-color: #1d4d43;      /* Deep green */
    --primary-light: #2a6f61;
    --primary-dark: #12332c;
    --secondary-color: #c3754c;    /* Terracotta */
    --accent-green: #4caf50;       /* Vibrant accent green */
    --cream-bg: #f2efec;           /* Warm cream */
    --white: #ffffff;
    --gray-light: #f8f9fa;
    --gray-medium: #e9ecef;
    --gray-dark: #6c757d;
    --text-color: #333333;
    --text-muted: #666666;
    
    /* Typography */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Quicksand', sans-serif;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 50px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(29, 77, 67, 0.08);
    --shadow-md: 0 8px 24px rgba(29, 77, 67, 0.12);
    --shadow-lg: 0 16px 40px rgba(29, 77, 67, 0.16);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* CSS Reset & General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.05rem; }
h6 { font-size: 0.95rem; }

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, select, textarea {
    font-family: inherit;
    outline: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Common Layout Helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.text-center { text-align: center; }

/* Section Header Styles */
.section-header {
    margin-bottom: 40px;
    text-align: center;
}

.section-header h2 {
    font-size: 2.2rem;
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

/* Left-aligned section headers override to prevent centering underline */
.section-header[style*="text-align: left"] h2::after,
.section-header[style*="text-align:left"] h2::after,
.section-header.text-left h2::after {
    left: 0;
    transform: none;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 10px;
}

/* Premium Custom Styled Select Fields Across Website */
select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d4d43' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    background-size: 14px !important;
    padding-right: 40px !important;
    background-color: var(--white) !important;
    cursor: pointer;
    border: 1px solid var(--gray-dark);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(29, 77, 67, 0.1) !important;
}

/* Custom Styled Select Dropdown Component (Matches User Screenshot Look in Color) */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background-color: var(--white);
    border: 1px solid var(--gray-dark);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-sizing: border-box;
}

.custom-select-trigger:hover,
.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(29, 77, 67, 0.05);
}

.custom-select-trigger i {
    font-size: 0.8rem;
    color: var(--primary-color);
    transition: transform var(--transition-fast);
    margin-left: 10px;
}

.custom-select-wrapper.open .custom-select-trigger i {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background-color: var(--white);
    border: 1px solid var(--gray-medium);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(29, 77, 67, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000; /* Ensure overlay displays above content elements */
    padding: 8px;
    max-height: 250px;
    overflow-y: auto;
    box-sizing: border-box;
}

.custom-select-wrapper.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-option {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    text-align: left;
    box-sizing: border-box;
}

.custom-select-option:last-child {
    margin-bottom: 0;
}

/* Hover effect on options (soft primary-green background highlight) */
.custom-select-option:hover {
    background-color: rgba(29, 77, 67, 0.05);
    color: var(--primary-color);
}

/* Active selected item (matches user screenshot shape: soft brand-gold highlight & colored text) */
.custom-select-option.selected {
    background-color: rgba(214, 140, 69, 0.12) !important;
    color: var(--secondary-color) !important;
}

/* Custom rounded utility wrapper override for round selector shapes */
.custom-select-wrapper.sort-select .custom-select-trigger,
.custom-select-wrapper.sort-select .custom-select-options {
    border-radius: var(--radius-full);
}
.custom-select-wrapper.sort-select .custom-select-options {
    border-radius: var(--radius-md); /* Keep options list container box shaped */
}

/* Fix double border, nested boxes and double arrow on custom select wrappers (override inherited classes) */
.custom-select-wrapper {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    background-image: none !important;
    background-repeat: no-repeat !important;
    box-shadow: none !important;
}

/* Base styling for desktop filter row layout */
.horizontal-filter-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* Force custom selects to be inline and auto-fit text width on the shop catalog filter bar */
.horizontal-filter-row .custom-select-wrapper {
    width: auto !important;
    display: inline-block !important;
    margin-right: 12px;
}

.horizontal-filter-row .custom-select-wrapper:last-child {
    margin-right: 0;
}

/* Prevent double arrow and adjust size on sort dropdown */
.custom-select-wrapper.sort-select {
    width: auto !important;
    min-width: 140px !important;
}

/* Align sort options dropdown to the right to prevent overflowing the right edge of the screen */
.custom-select-wrapper.sort-select .custom-select-options {
    left: auto !important;
    right: 0 !important;
}

/* Ensure trigger fits text content exactly on catalog filters, but occupies 100% on standard forms */
.custom-select-trigger {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.horizontal-filter-row .custom-select-trigger,
.sort-select .custom-select-trigger {
    display: inline-flex !important;
    width: auto !important;
    white-space: nowrap !important;
}

/* Options dropdown container automatically wraps based on option text length */
.custom-select-options {
    width: max-content !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
}

/* Price filter dropdown width on desktop */
.price-dropdown-box {
    width: 320px;
}

/* Double Range Price Slider Thumbs Styling */
#price-range-min::-webkit-slider-thumb,
#price-range-max::-webkit-slider-thumb {
    height: 18px !important;
    width: 18px !important;
    border-radius: 50% !important;
    background: var(--white) !important;
    border: 2px solid var(--primary-color) !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    -webkit-appearance: none !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
    transition: transform var(--transition-fast) !important;
}

#price-range-min::-webkit-slider-thumb:hover,
#price-range-max::-webkit-slider-thumb:hover {
    transform: scale(1.15) !important;
}

#price-range-min::-moz-range-thumb,
#price-range-max::-moz-range-thumb {
    height: 16px !important;
    width: 16px !important;
    border-radius: 50% !important;
    background: var(--white) !important;
    border: 2px solid var(--primary-color) !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
}

/* Styled Premium Custom Scrollbar for Options Dropdowns */
.custom-select-options::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}

.custom-select-options::-webkit-scrollbar-track {
    background: transparent !important;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background-color: rgba(29, 77, 67, 0.2) !important; /* Soft brand forest-green color track */
    border-radius: 10px !important;
    border: 1px solid transparent !important;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background-color: rgba(29, 77, 67, 0.45) !important; /* Darken brand-green on hover */
}

/* Full-width Custom Select Utility Classes */
.custom-select-wrapper.full-width {
    width: 100% !important;
    display: block !important;
}

.custom-select-wrapper.full-width .custom-select-trigger {
    width: 100% !important;
    display: inline-flex !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
}

.custom-select-wrapper.full-width .custom-select-options {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Color Circle selector active premium outline ring styling */
.color-circle-btn.active {
    box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--secondary-color) !important;
    transform: scale(1.1);
}

/* Mega Menu Dropdown Core Layout */
.has-mega-menu {
    /* position: relative; removed to align dropdown with .header-container instead of li parent */
}

.header-container {
    position: relative !important;
}

.has-mega-menu:hover > a i {
    transform: rotate(180deg);
}

.mega-menu-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background-color: var(--white);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08), 0 5px 15px rgba(29,77,67,0.04);
    border-radius: var(--radius-md) !important;
    border-top: 3px solid var(--primary-color);
    padding: 35px 25px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-sizing: border-box;
    transform: translateY(15px);
}

.has-mega-menu:hover .mega-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0;
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    align-items: start;
}

/* Mega Menu Columns */
.mega-menu-col {
    display: flex;
    flex-direction: column;
}

.mega-menu-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 20px;
    margin-top: 0;
    border-bottom: 1.5px solid var(--gray-medium);
    padding-bottom: 8px;
}

.mega-menu-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mega-menu-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.mega-menu-links a:hover {
    color: var(--secondary-color);
    transform: translateX(4px);
}

/* Badge Tags inside Mega Menu */
.mega-menu-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.mega-menu-badge.new {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--accent-green);
}

.mega-menu-badge.hot {
    background-color: rgba(233, 30, 99, 0.1);
    color: #e91e63;
}

.mega-menu-badge.nasa {
    background-color: rgba(33, 150, 243, 0.1);
    color: #2196f3;
}

.mega-menu-badge.easy {
    background-color: rgba(214, 140, 69, 0.12);
    color: var(--secondary-color);
}

/* Featured Promotion Block */
.mega-menu-col.featured {
    grid-column: span 1;
}

.mega-menu-promo {
    position: relative;
    display: block;
    height: 100%;
    min-height: 200px;
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.mega-menu-promo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.5s ease;
}

.mega-menu-promo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(29,77,67,0.1) 20%, rgba(29,77,67,0.85) 90%);
    z-index: 1;
}

.mega-menu-promo:hover img {
    transform: scale(1.08);
}

.mega-menu-promo:hover {
    box-shadow: var(--shadow-md);
}

.promo-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    z-index: 2;
    color: var(--white);
}

.promo-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.promo-content h4 {
    margin: 0 0 12px 0;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.promo-btn {
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.mega-menu-promo:hover .promo-btn {
    gap: 10px;
}

/* Simple Dropdown Menu Styling */
.has-simple-dropdown {
    position: relative;
}

.has-simple-dropdown:hover > a i {
    transform: rotate(180deg);
}

.simple-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 190px;
    background-color: var(--white);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08), 0 3px 10px rgba(29,77,67,0.03);
    border-radius: var(--radius-sm);
    border-top: 3px solid var(--primary-color);
    padding: 10px 0;
    list-style: none;
    margin: 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    transform: translateY(10px);
}

.has-simple-dropdown:hover .simple-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.simple-dropdown-menu li {
    width: 100%;
}

.simple-dropdown-menu a {
    display: block !important;
    padding: 8px 20px !important;
    font-size: 0.9rem !important;
    color: var(--text-color) !important;
    font-weight: 500 !important;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.simple-dropdown-menu a::after {
    display: none !important; /* Remove standard underline hover animation */
}

.simple-dropdown-menu a:hover {
    background-color: rgba(29, 77, 67, 0.04) !important;
    color: var(--secondary-color) !important;
    padding-left: 24px !important;
}

/* Critical FOUC prevention: Hide mobile filters drawer initially until pages.css loading is complete */
@media (max-width: 992px) {
    .mobile-filter-drawer {
        display: none;
    }
}


