/* --- Top Banner --- */
.top-banner {
    background-color: #355057;
    color: #fff;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.top-banner a {
    color: #fff;
    margin-left: 0.5rem;
    text-decoration: underline;
    font-weight: 600;
}

.top-banner a:hover {
    color: #f5f5f5;
}

/* --- NEW: Brand Color Palette & Font --- */
:root {
    --brand-green: #7fa87a;
    /* Primary green used for buttons/links */
    --brand-green-dark: #2d4a3e;
    /* Deeper, richer green */
    --brand-green-light: #8fbc8f;
    /* Softer sage green */
    --brand-orange: #e07a5f;
    /* Terracotta orange */
    --brand-background: #ffffff;
    /* White */
    --brand-text: #2c3e50;
    /* Dark blue-gray for text */
    --brand-accent: #f4a261;
    /* Sandy orange for accents */
    --font-family-brand: 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 12px;
    --radius-lg: 24px;

    /* Education-blue header theme */
    --edu-blue-primary: #1a365d;
    --edu-blue-secondary: #2d3748;
    --edu-blue-accent: #3182ce;
    --edu-blue-light: #ebf8ff;

    /* Header dimensions */
    --header-height-mobile: 56px;
    --search-height-mobile: 48px;
    --category-nav-height: 52px;
    --drawer-width: 320px;
}

/* --- Universal Box Sizing --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0 auto;
    padding: 0;
    font-family: var(--font-family-brand);
    background-color: var(--brand-background);
    color: var(--brand-text);
}

/* --- NEW: Container for Header Image and Benefits Bar --- */
.header-group {
    max-width: 1500px;
    margin: 0 auto 2rem;
    /* Center the group and add space below */
}

/* --- NEW: Mobile Category Navigation --- */
.mobile-category-nav {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e0e0d1;
    position: fixed;
    /* Changed from sticky to fixed */
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    /* Fixed height for consistency */
    z-index: 100;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
    align-items: center;
    /* Center items vertically */
}

.mobile-category-nav::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.category-pill {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f0f2f5;
    border-radius: 999px;
    text-decoration: none;
    color: var(--brand-text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    border: 1px solid transparent;
}

.category-pill:hover {
    background: var(--brand-green-light);
    color: #fff;
}

.category-pill:active {
    background: var(--brand-green-dark);
    color: #fff;
}

/* --- Full-width Header Image (within its container) --- */
.header-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Benefits Bar (aligned under image) --- */
.site-header-benefits {
    background-color: var(--brand-green-dark);
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.benefit-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    /* Add some space between check and text */
}

.main-container {
    padding: 0 1.5rem 2rem;
    /* Adjusted top padding */
    max-width: 1500px;
    margin: 0 auto;
}

.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

.panel {
    margin-bottom: 1.5rem;
}

h3 {
    margin: 0 0 .5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-green-dark);
}

/* <!-- MODIFIED: Removed old hit styles, new styles are below --> */

.topbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.topbar>* {
    flex: 1 1 auto;
}

/* --- UPDATED: Styles for collapsible filter panel --- */
.filter-panel details {
    border: 1px solid #e0e0d1;
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: #fff;
}

.filter-panel summary {
    font-weight: 600;
    padding: 0.75rem 1rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f7f5e9;
    border-radius: 8px 8px 0 0;
}

.filter-panel details[open] summary {
    border-bottom: 1px solid #e0e0d1;
}

.filter-panel summary::-webkit-details-marker {
    display: none;
}

.filter-panel summary::after {
    content: '▾';
}

.filter-panel details[open] summary::after {
    content: '▴';
}

.filter-panel-body {
    padding: 1rem;
}

.facet-search-container {
    margin-bottom: 0.5rem;
}

/* --- NEW: Clear Filters button styles --- */
.clear-filters-container {
    margin-bottom: 1rem;
}

.filter-section-title {
    margin: 1.25rem 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: #4c4f5a;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Simplified, no gradients/shadows. Match filter panel look. */

/* Match the "Show more" pill look */
.clear-filters-button,
.ais-ClearRefinements-button {
    appearance: none;
    display: block;
    width: 100%;
    padding: 0.55rem 1rem;
    border: 1px solid #cfd2e5;
    /* soft bluish like show more */
    border-radius: 10px;
    background: #fff;
    color: #1f2432;
    /* dark text similar to theme */
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 0 0 2px rgba(207, 210, 229, 0.35) inset;
    /* subtle inner ring */
    background-image: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.clear-filters-button:hover,
.ais-ClearRefinements-button:hover {
    border-color: #b9bedb;
    box-shadow: 0 0 0 2px rgba(185, 190, 219, 0.5) inset;
}

/* Disabled state - clearly muted, no fades */
.ais-ClearRefinements-button--disabled,
.clear-filters-button:disabled {
    background: #fff;
    border-color: #e6e8f2;
    color: #9aa0b2;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

/* --- NEW: Homepage Action Buttons Styles --- */
.homepage-action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0 3rem 0;
    flex-wrap: wrap;
}

.action-button {
    display: inline-block;
    text-decoration: none;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 140px;
}

.facebook-button {
    background-color: #3b5998;
    /* Facebook blue */
    color: #fff;
}

.facebook-button:hover {
    background-color: #2d4373;
    /* Darker blue */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 89, 152, 0.3);
}

.email-button {
    background-color: var(--brand-orange);
    color: #fff;
}

.email-button:hover {
    background-color: #d66043;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 111, 81, 0.3);
}

/* --- NEW: Static Homepage Styles --- */
.static-homepage {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: #fff;
}

/* --- Hero Banner --- */
.hero-banner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1rem 0;
}

.hero-banner-inner {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.hero-banner-image {
    width: 100%;
    height: auto;
    display: block;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    text-align: center;
    color: #fff;
}

.hero-headline {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.hero-subline {
    font-size: 1.1rem;
    margin: 0 0 1.25rem;
    opacity: 0.95;
}

.hero-cta {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: var(--brand-green);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 50px;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.hero-cta:hover {
    background: var(--brand-green-dark);
    transform: translateY(-2px);
}

@media (max-width: 600px) {
    .hero-banner {
        padding: 0;
    }

    .hero-banner-inner {
        border-radius: 0;
        box-shadow: none;
        overflow: hidden;
        position: relative;
    }

    .hero-banner-image {
        width: 100%;
        height: 70vw;
        object-fit: cover;
        object-position: center;
    }

    .hero-overlay {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
        padding: 2rem 1.25rem 1.5rem;
        text-align: center;
    }

    .hero-headline {
        font-size: 1.3rem;
        color: #fff;
        margin-bottom: 0.5rem;
    }

    .hero-subline {
        font-size: 0.9rem;
        color: rgba(255,255,255,0.95);
        margin-bottom: 0;
    }

    .hero-cta {
        display: none;
    }
}

/* --- Life Skills Slider --- */
.life-skills-slider {
    background: #fff;
    padding: 1.5rem 0;
    overflow: hidden;
    position: relative;
}

/* Mobile scroll indicator - arrow on right edge */
.life-skills-slider::before {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    width: 12px;
    height: 12px;
    border-right: 3px solid rgba(0,0,0,0.4);
    border-bottom: 3px solid rgba(0,0,0,0.4);
    transform: translateY(-50%) rotate(-45deg);
    pointer-events: none;
    z-index: 3;
}

/* Mobile scroll indicator - gradient fade on right edge */
.life-skills-slider::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 100%;
    background: linear-gradient(to left, rgba(255,255,255,1) 0%, rgba(255,255,255,0.9) 50%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

.life-skills-track {
    display: flex;
    gap: 0.75rem;
    padding: 0 0 0 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}

.life-skills-track::after {
    content: '';
    flex: 0 0 1rem;
}

.life-skills-track::-webkit-scrollbar {
    display: none;
}

.life-skill-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--brand-text);
    padding: 0.5rem;
    scroll-snap-align: start;
    transition: transform 0.2s ease;
}

.life-skill-item:hover {
    transform: translateY(-4px);
}

.life-skill-icon {
    width: 90px;
    height: 90px;
    margin-bottom: 0.5rem;
}

.life-skill-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.life-skill-name {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    color: var(--brand-text);
}

@media (min-width: 601px) {
    .life-skills-slider {
        padding: 2rem 1rem;
        max-width: 1200px;
        margin: 0 auto;
    }

    /* Hide scroll indicators on desktop */
    .life-skills-slider::before,
    .life-skills-slider::after {
        display: none;
    }

    .life-skills-track::after {
        display: none;
    }

    .life-skills-track {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem 1rem;
        overflow-x: visible;
        padding: 0;
    }

    .life-skill-item {
        scroll-snap-align: unset;
    }

    .life-skill-icon {
        width: 120px;
        height: 120px;
    }

    .life-skill-name {
        font-size: 1rem;
    }
}

.homepage-hero {
    padding: 2rem 1.5rem 3rem;
    text-align: center;
}

.homepage-content {
    max-width: 900px;
    margin: 0 auto;
}

.homepage-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--brand-green-dark);
    margin-bottom: 1rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.homepage-description {
    font-size: 1.35rem;
    color: #556b63;
    margin-bottom: 3rem;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Container for the Search Bar and Button --- */
.search-container {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 680px;
    height: 60px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    border-radius: 50px;
    background: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-container:hover,
.search-container:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* --- Style the Search Input Field --- */
.search-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0 70px 0 2rem;
    font-family: inherit;
    font-size: 1.1rem;
    line-height: normal;
    vertical-align: middle;
    border: 2px solid transparent;
    border-radius: 50px;
    outline: none;
    background: transparent;
    color: var(--brand-text);
    box-sizing: border-box;
}

.search-input::placeholder {
    color: #9ca3af;
    line-height: normal;
}

.search-input:focus {
    border-color: var(--brand-green-light);
    box-shadow: none;
}

/* --- Amazon-style Search Button --- */
.search-button {
    position: absolute;
    right: 6px;
    top: 6px;
    bottom: 6px;
    width: 48px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background-color: var(--brand-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.search-button:hover {
    background-color: #d66043;
    transform: scale(1.05);
}

.search-button svg {
    color: #fff;
    width: 24px;
    height: 24px;
}

.search-subtext {
    margin-top: 1rem;
    font-size: 1rem;
    color: #5f7068;
    text-align: center;
}

/* --- Recommended search link under the homepage search bar --- */
.recommended-search {
    text-align: center;
    margin-top: 0.75rem;
}
.recommended-search a {
    display: inline-block;
    font-weight: 700;
    color: var(--brand-green-dark);
    text-decoration: none;
    background: rgba(127,168,122,0.06);
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(127,168,122,0.12);
    font-size: 0.98rem;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}
.recommended-search a:hover,
.recommended-search a:focus {
    background: var(--brand-green-light);
    color: #fff;
    transform: translateY(-1px);
}

/* --- Removed old search button styles as they are now integrated above --- */

.homepage-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 4rem auto;
    max-width: 1100px;
    padding: 0 1.5rem;
}

.feature-card {
    background: #fff;
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    border: none;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--brand-green-light);
    transition: height 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.feature-card:hover::before {
    height: 100%;
    opacity: 0.05;
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand-green-dark);
    margin-bottom: 1rem;
    position: relative;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
    margin: 0;
    font-size: 1.05rem;
    position: relative;
}


/* --- Social Proof Section (Marquee in Hero) --- */
.social-proof-section {
    margin: 2rem 0 0 0;
    /* Top margin only */
    padding: 1rem 0;
    background: transparent;
    /* Transparent background for hero integration */
    overflow: hidden;
    width: 100%;
}

.social-proof-heading {
    text-align: center;
    font-size: 1.2rem;
    /* Smaller heading for hero context */
    font-weight: 700;
    color: var(--brand-text);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    opacity: 0.8;
}

.testimonial-marquee {
    width: 100%;
    position: relative;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.testimonial-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation: scroll 90s linear infinite;
    padding: 0.5rem 0;
    /* Minimal padding */
    align-items: center;
}

.testimonial-track:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
        /* Move half the width */
    }
}

.testimonial-image {
    height: 120px;
    /* Fixed height for consistent marquee */
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
    display: block;
}

.testimonial-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    z-index: 10;
}

/* --- NEW: Build Real Focus Section Styles --- */
.focus-skills-section {
    background: #f0faf0;
    padding: 3rem 1.5rem;
    margin: 0 1rem;
    border-radius: 24px;
}

.focus-skills-heading {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-text);
    text-align: center;
    margin: 0 0 2rem;
    letter-spacing: -0.02em;
}

.focus-skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 540px;
    margin: 0 auto;
}

.focus-skill-card {
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: transform 0.2s ease;
}

.focus-skill-card:hover {
    transform: translateY(-4px);
}

.focus-skill-image {
    aspect-ratio: 1;
    margin-bottom: 1rem;
}

.focus-skill-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.focus-skill-card:hover .focus-skill-image img {
    transform: scale(1.05);
}

.focus-skill-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-text);
    margin: 0 0 0.25rem;
}

.focus-skill-category {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* Mobile responsive for focus skills */
@media (max-width: 600px) {
    .focus-skills-section {
        padding: 2rem 1rem;
    }

    .focus-skills-heading {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .focus-skills-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .focus-skill-image {
        border-radius: 12px;
        margin-bottom: 0.5rem;
    }

    .focus-skill-title {
        font-size: 0.75rem;
    }

    .focus-skill-category {
        font-size: 0.7rem;
    }
}

/* --- NEW: Garden Time Section Styles --- */
.garden-section {
    background: #f5f0fa;
    padding: 3rem 1.5rem;
    margin: 0 1rem;
    border-radius: 24px;
}

.garden-heading {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-text);
    text-align: center;
    margin: 0 0 2rem;
    letter-spacing: -0.02em;
}

.garden-emoji {
    display: inline-block;
}

.garden-hero {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.garden-hero-image {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.garden-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
}

.garden-card {
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: transform 0.2s ease;
}

.garden-card:hover {
    transform: translateY(-4px);
}

.garden-icon {
    aspect-ratio: 1;
    margin-bottom: 0.75rem;
}

.garden-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.garden-card:hover .garden-icon img {
    transform: scale(1.05);
}

.garden-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-text);
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.garden-subtitle {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

@media (max-width: 600px) {
    .garden-section {
        padding: 2rem 1rem;
    }

    .garden-heading {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .garden-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .garden-title {
        font-size: 0.85rem;
    }

    .garden-subtitle {
        font-size: 0.75rem;
    }
}

/* --- NEW: Exploration and Observation Section Styles --- */
.butterfly-section {
    background: #fff;
    padding: 3rem 1.5rem;
    margin: 0;
}

.butterfly-section-heading {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-green-dark);
    text-align: center;
    margin: 0 0 1.5rem;
}

.butterfly-hero {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.butterfly-hero-image {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.butterfly-stages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.butterfly-stage {
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: transform 0.2s ease;
}

.butterfly-stage:hover {
    transform: translateY(-4px);
}

.butterfly-stage-icon {
    aspect-ratio: 1;
    margin-bottom: 0.75rem;
    max-width: 120px;
    margin-left: auto;
    margin-right: auto;
}

.butterfly-stage-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.butterfly-stage:hover .butterfly-stage-icon img {
    transform: scale(1.05);
}

.butterfly-stage-label {
    margin-top: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-text);
    line-height: 1.3;
}

@media (max-width: 600px) {
    .butterfly-section {
        padding: 2rem 1rem;
    }

    .butterfly-section-heading {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .butterfly-hero {
        margin-bottom: 1.5rem;
    }

    .butterfly-stages {
        gap: 1rem;
    }

    .butterfly-stage-icon {
        max-width: 80px;
    }

    .butterfly-stage-label {
        font-size: 0.85rem;
    }
}

/* --- Organization Section Styles --- */
.organization-section {
    padding: 3rem 1.5rem;
    background: #fff;
    text-align: center;
}

.organization-section-heading {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-green-dark);
    margin: 0 0 1.5rem;
}

.organization-hero {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.organization-hero-image {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.organization-items {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
}

.organization-item {
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: transform 0.2s ease;
}

.organization-item:hover {
    transform: translateY(-4px);
}

.organization-icon {
    aspect-ratio: 1;
    margin-bottom: 0.75rem;
    max-width: 120px;
    margin-left: auto;
    margin-right: auto;
}

.organization-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.organization-item:hover .organization-icon img {
    transform: scale(1.05);
}

.organization-item-label {
    margin-top: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-text);
    line-height: 1.3;
}

@media (max-width: 600px) {
    .organization-section {
        padding: 2rem 1rem;
    }

    .organization-section-heading {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .organization-hero {
        margin-bottom: 1.5rem;
    }

    .organization-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .organization-icon {
        max-width: 80px;
    }

    .organization-item-label {
        font-size: 0.85rem;
    }
}

/* --- Music Section Styles --- */
.music-section {
    padding: 3rem 1.5rem;
    background: #fff;
    text-align: center;
}

.music-section-heading {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-green-dark);
    margin: 0 0 1.5rem;
}

.music-hero {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.music-hero-image {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.music-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.music-item {
    flex: 0 0 calc(20% - 1.2rem);
    max-width: calc(20% - 1.2rem);
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: transform 0.2s ease;
}

.music-item:hover {
    transform: translateY(-4px);
}

.music-icon {
    aspect-ratio: 1;
    margin-bottom: 0.75rem;
    max-width: 120px;
    margin-left: auto;
    margin-right: auto;
}

.music-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.music-item:hover .music-icon img {
    transform: scale(1.05);
}

.music-item-title {
    display: block;
    margin-top: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-text);
    line-height: 1.3;
}

.music-item-subtitle {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #888;
    margin-top: 0.2rem;
}

@media (max-width: 600px) {
    .music-section {
        padding: 2rem 1rem;
    }

    .music-section-heading {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .music-hero {
        margin-bottom: 1.5rem;
    }

    .music-items {
        gap: 1rem;
    }

    .music-item {
        flex: 0 0 calc(33.333% - 0.7rem);
        max-width: calc(33.333% - 0.7rem);
    }

    .music-icon {
        max-width: 80px;
    }

    .music-item-title {
        font-size: 0.85rem;
    }

    .music-item-subtitle {
        font-size: 0.75rem;
    }
}

/* --- NEW: Homepage Products Section Styles --- */
.homepage-products-section {
    margin: 4rem auto;
    max-width: 1500px;
    padding: 0 1.5rem;
}

.homepage-products-section .homepage-products-heading {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--brand-green-dark);
    margin: 0 0 0.5rem;
    line-height: 1.2;
    text-align: left;
}

.homepage-products-last-updated {
    font-size: 0.95rem;
    font-family: var(--font-family-brand);
    color: var(--brand-green-light);
    margin: 0 0 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
}

.homepage-category-sections {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    margin-top: 2rem;
}

.homepage-category-section {
    background: transparent;
    border: none;
    padding: 0;
}

.homepage-category-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.homepage-category-copy h3 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--brand-green-dark);
}

.homepage-category-copy p {
    margin: 0.35rem 0 0;
    color: #555;
    font-size: 0.95rem;
}

.homepage-category-cta {
    text-decoration: none;
    font-weight: 700;
    color: #fff;
    background: var(--brand-green-dark);
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.homepage-category-cta:hover {
    background: #2a4430;
    transform: translateY(-1px);
}

.homepage-loading-message,
.homepage-load-error {
    text-align: center;
    padding: 2rem 1rem;
    font-weight: 600;
    color: #555;
}

.homepage-empty-state {
    padding: 2rem;
    margin: 0 auto;
    border: 1px dashed #e0e0d1;
    border-radius: 12px;
    background: #f9f7ef;
    color: #777;
    font-weight: 600;
    width: 100%;
}

.homepage-products-carousel {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.homepage-products-track-wrapper {
    overflow: hidden;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.homepage-products-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 1rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
}

.homepage-products-track::-webkit-scrollbar {
    display: none;
}

.carousel-nav {
    background: #fff;
    border: 1px solid var(--brand-green-light);
    color: var(--brand-green-dark);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.carousel-nav:hover {
    background: var(--brand-green-light);
    color: #fff;
    transform: translateY(-1px);
}

.carousel-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f3f3f3;
    color: #888;
    transform: none;
    box-shadow: none;
}

/* Homepage product card wrapper */
.homepage-product-card-wrapper {
    flex: 0 0 280px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    overflow: hidden;
    transition: all 0.3s ease;
    scroll-snap-align: start;
    box-shadow: var(--shadow-sm);
}

.homepage-product-card-wrapper:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(143, 188, 143, 0.3);
}

.homepage-product-card-wrapper .homepage-product-card {
    box-shadow: none;
    border: none;
    border-radius: 0;
    flex: 0 0 auto;
    max-width: 100%;
}

.homepage-product-card-wrapper .homepage-product-card:hover {
    transform: none;
    box-shadow: none;
}

.homepage-product-card {
    flex: 0 0 280px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    overflow: hidden;
    text-decoration: none;
    color: var(--brand-text);
    transition: all 0.3s ease;
    scroll-snap-align: start;
    box-shadow: var(--shadow-sm);
}

.homepage-product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(143, 188, 143, 0.3);
}

.homepage-product-card:hover .homepage-product-title {
    color: var(--brand-orange);
}

.homepage-product-card--sold-out {
    opacity: 0.85;
}

.homepage-product-card--sold-out .homepage-product-image img {
    filter: grayscale(30%);
}

.homepage-sold-out-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #dc2626;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

.homepage-product-brand {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.homepage-product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 4px 0;
}

.homepage-product-stars {
    display: inline-flex;
    font-size: 0.8rem;
    line-height: 1;
}

.homepage-product-stars .star {
    color: #fbbf24;
}

.homepage-product-stars .star-full {
    color: #f59e0b;
}

.homepage-product-stars .star-empty {
    color: #d1d5db;
}

.homepage-product-rating-text {
    font-size: 0.7rem;
    color: #6b7280;
}

.homepage-product-image {
    width: 100%;
    padding-top: 80%;
    /* Taller image area */
    position: relative;
    background-color: #f0f2f5;
    overflow: hidden;
}

.homepage-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensure it covers nicely */
    transition: transform 0.5s ease;
}

.homepage-product-card:hover .homepage-product-image img {
    transform: scale(1.05);
}

.homepage-product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.homepage-product-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--brand-green-dark);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.homepage-product-description {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #666;
}

.homepage-product-meta {
    font-size: 0.8rem;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 0.25rem;
    column-gap: 1rem;
}

.homepage-product-price {
    font-weight: 700;
    color: var(--brand-green-dark);
    margin-left: auto;
    flex-shrink: 0;
}

.homepage-product-sold-out {
    font-weight: 600;
    color: #c05621;
    flex-basis: 100%;
}

.homepage-product-supplier {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.homepage-product-seen {
    flex-basis: 100%;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    color: #888;
}

@media (max-width: 900px) {
    .homepage-products-carousel {
        gap: 0.75rem;
    }

    .homepage-products-track {
        gap: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .homepage-product-card,
    .homepage-product-card-wrapper {
        flex: 0 0 85%;
        max-width: 85%;
    }

    .carousel-nav {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .homepage-product-title {
        font-size: 0.95rem;
    }

    .homepage-product-description {
        font-size: 0.8rem;
    }
}

@media (max-width: 640px) {
    .homepage-category-section {
        background: transparent;
        border: none;
        padding: 1rem 0;
        box-shadow: none;
    }

    .homepage-products-carousel {
        gap: 0;
    }

    .homepage-products-track {
        padding: 0;
        gap: 0.5rem;
    }

    .homepage-product-card,
    .homepage-product-card-wrapper {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .carousel-nav {
        display: none;
    }
}

/* --- NEW: Style for the "sub-header" info box in the top bar --- */
.sub-header-topbar {
    flex: 1 1 100%;
    /* Allow it to wrap and take full width if needed */
    font-size: 0.95rem;
    color: #444;
    line-height: 1.5;
    background-color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #e0e0d1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-width: 250px;
}

.sub-header-topbar a {
    color: var(--brand-orange);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sub-header-topbar a:hover {
    color: var(--brand-green-dark);
}

/* Tooltip Styles */
.tooltip-container {
    position: relative;
    display: inline-block;
    cursor: help;
    color: var(--brand-green-dark);
    margin-left: 4px;
    font-weight: bold;
}

.tooltip-text {
    visibility: hidden;
    width: 260px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 12px;
    position: absolute;
    z-index: 100;
    bottom: 140%;
    /* Position above */
    left: 50%;
    margin-left: -130px;
    /* Center */
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    font-size: 0.9rem;
    font-weight: normal;
    line-height: 1.4;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
}

/* Tooltip Arrow */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    bottom: 125%;
    /* Small animation up */
}


/* --- UPDATED: Algolia Widget Overrides --- */

/* Remove white box behind rounded search */
.ais-SearchBox-form {
    background: transparent !important;
    /* Override theme default */
}

/* --- NEW: Specific styles for TOPBAR search/sort --- */
.topbar .ais-SearchBox-input,
.topbar .ais-SortBy-select {
    height: 44px;
    border-radius: 22px;
    border: 1px solid #ccc;
    background-color: #fff;
}

.topbar .ais-SearchBox-input:focus,
.topbar .ais-SortBy-select:focus {
    border-color: var(--brand-green-light);
    box-shadow: 0 0 0 3px rgba(163, 177, 138, 0.3);
    outline: none;
}

.topbar .ais-SearchBox-input {
    padding-left: 2.5rem;
    /* Pushes text past the icon */
}

/* --- NEW: Specific styles for FILTER PANEL search --- */
.filter-panel .ais-SearchBox-input {
    height: 36px;
    /* Reduced height */
    border-radius: 18px;
    /* Adjusted radius */
    border: 1px solid #ccc;
    background-color: #fff;
    background-position: center left 0.75rem;
    padding-left: 2.25rem;
    display: flex;
    /* Vertically align content */
    align-items: center;
    /* Vertically align content */
}

.filter-panel .ais-SearchBox-input:focus {
    border-color: var(--brand-green-light);
    box-shadow: 0 0 0 3px rgba(163, 177, 138, 0.3);
    outline: none;
}

/* Category search box in filter panel */
.category-search-box {
    margin-bottom: 12px;
}

.category-search-box .ais-SearchBox-form {
    display: flex;
}

.category-search-box .ais-SearchBox-input,
#category-search-input {
    width: 100%;
    height: 36px;
    border-radius: 18px;
    border: 1px solid #ccc;
    background-color: #fff;
    padding: 0 12px;
    font-size: 13px;
    font-family: var(--font-family-brand);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#category-search-input:focus {
    border-color: var(--brand-green-light);
    box-shadow: 0 0 0 3px rgba(163, 177, 138, 0.3);
}

#category-search-input::placeholder {
    color: #888;
}

/* <!-- MODIFIED: Removed old ais-Hits-item styles --> */
.ais-CurrentRefinements-item,
.ais-Pagination-item {
    border-radius: 15px;
}

.ais-Pagination-item--selected {
    background-color: var(--brand-green-dark);
    border-color: var(--brand-green-dark);
}

/* --- NEW: Pagination Fix for Mobile --- */
.ais-Pagination-list {
    display: flex;
    /* Use flexbox for alignment */
    flex-wrap: wrap;
    /* Allow items to wrap to the next line */
    justify-content: center;
    /* Center the pagination links */
}

/* --- START: Added styles for rangeInput widget --- */
.ais-RangeInput-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ais-RangeInput-label {
    flex-shrink: 0;
}

.ais-RangeInput-input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.ais-RangeInput-separator {
    flex-shrink: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.ais-RangeInput-submit {
    width: 32px;
    height: 32px;
    padding: 0;
    background-color: var(--brand-green-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.ais-RangeInput-submit:hover {
    background-color: #2a4430;
}

/* --- END: Added styles for rangeInput widget --- */

/* --- START: Added styles for ratingMenu widget --- */
.ais-RatingMenu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ais-RatingMenu-item {
    padding: 0.35rem 0;
}

.ais-RatingMenu-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--brand-text);
    cursor: pointer;
}

.ais-RatingMenu-link:hover {
    color: var(--brand-green-dark);
}

.ais-RatingMenu-item--selected .ais-RatingMenu-link {
    font-weight: 600;
    color: var(--brand-green-dark);
}

.ais-RatingMenu-starIcon {
    width: 16px;
    height: 16px;
}

.ais-RatingMenu-starIcon--full {
    fill: #fbbf24;
}

.ais-RatingMenu-starIcon--empty {
    fill: #d1d5db;
}

.ais-RatingMenu-label {
    margin-left: 0.25rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.ais-RatingMenu-count {
    margin-left: auto;
    background-color: #f3f4f6;
    color: #6b7280;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.ais-RatingMenu-item--disabled {
    opacity: 0.5;
    pointer-events: none;
}
/* --- END: Added styles for ratingMenu widget --- */

/* --- START: Added styles for numericMenu widget (Customer Reviews) --- */
.ais-NumericMenu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ais-NumericMenu-item {
    padding: 0.25rem 0;
}

.ais-NumericMenu-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--brand-text);
}

.ais-NumericMenu-label:hover {
    color: var(--brand-green-dark);
}

.ais-NumericMenu-radio {
    accent-color: var(--brand-green-dark);
}

.ais-NumericMenu-item--selected .ais-NumericMenu-labelText {
    font-weight: 600;
    color: var(--brand-green-dark);
}

.ais-NumericMenu-labelText {
    color: var(--brand-text);
}
/* --- END: Added styles for numericMenu widget --- */

/* --- START: Added styles for hierarchicalMenu --- */
.ais-HierarchicalMenu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ais-HierarchicalMenu-list--child {
    margin-left: 1rem;
    padding-left: 0.5rem;
    border-left: 2px solid #e5e7eb;
}

.ais-HierarchicalMenu-item {
    padding: 0;
    margin: 0;
    border: none;
}

.ais-HierarchicalMenu-item > div {
    padding: 0;
    margin: 0;
}

.ais-HierarchicalMenu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: var(--brand-text);
    font-size: 0.875rem;
    padding: 0.35rem 0;
    cursor: pointer;
    border: none;
    background: none;
}

.ais-HierarchicalMenu-link::before {
    display: none !important;
}

.ais-HierarchicalMenu-link:hover {
    color: var(--brand-green-dark);
}

.ais-HierarchicalMenu-item--selected > div > .ais-HierarchicalMenu-link,
.ais-HierarchicalMenu-item--selected > .ais-HierarchicalMenu-link {
    font-weight: 600;
    color: var(--brand-green-dark);
}

.ais-HierarchicalMenu-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ais-HierarchicalMenu-count {
    background-color: #f3f4f6;
    color: #6b7280;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}
/* --- END: Added styles for hierarchicalMenu search --- */


/* <!-- MODIFIED: START: NEW STYLES for Product Grid --> */
.ais-Hits-list {
    display: grid;
    /* Define responsive grid columns */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.ais-Hits-item {
    /* Resetting InstantSearch default styles for the item wrapper */
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
}

/* Product card wrapper */
.product-card-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0d1;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.product-card-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border-color: var(--brand-green-light);
}

.product-card-wrapper .product-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
    transform: none;
}

.product-card-wrapper .product-card:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Make cards in a row equal height */
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0d1;
    overflow: hidden;
    /* Ensures content respects border-radius */
    text-decoration: none;
    color: var(--brand-text);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border-color: var(--brand-green-light);
}

.product-card:hover .product-title {
    color: var(--brand-orange);
}

.product-image {
    width: 100%;
    padding-top: 100%;
    /* Creates a 1:1 aspect ratio square */
    position: relative;
    background-color: #f7f7f7;
    /* Placeholder color */
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Crop image to fit, not stretch */
}

.product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Allows this container to fill available space */
}

.product-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--brand-green-dark);
    margin-bottom: 0.5rem;
    /* Clamp title to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-description {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    flex-grow: 1;
    /* Pushes meta-info to the bottom */
    /* Clamp description to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4em;
    /* <<< ADD THIS LINE */
}

/* MODIFIED RULE */
.product-meta {
    font-size: 0.8rem;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    /* Vertically align supplier and price */
    row-gap: 0.25rem;
    /* Space between the two lines */
    column-gap: 3.0rem;
    /* Space between supplier and price */
}

/* MODIFIED RULE */
.product-price {
    font-weight: 700;
    color: var(--brand-green-dark);
    margin-left: auto;
    /* Magic property to push it to the right */
    flex-shrink: 0;
    /* Prevent it from shrinking */
}

.product-sold-out {
    font-weight: 600;
    color: #c05621;
    flex-basis: 100%;
}

/* MODIFIED RULE for Supplier */
.product-supplier {
    /* This allows the supplier to grow but not exceed the available space */
    flex: 1 1 0;
    min-width: 0;
    /* Crucial for enabling truncation in a flex item */

    /* These properties handle the truncation with "..." */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* MODIFIED RULE for Date */
.product-seen {
    /* Force this element to a new line by taking 100% of the width */
    flex-basis: 100%;
    margin-bottom: 0.25rem;
    /* Adds space below the date */
}

/* <!-- MODIFIED: END: NEW STYLES for Product Grid --> */

/* --- Legal Disclaimer Footer --- */
.legal-disclaimer {
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0d1;
    padding: 2rem 1.5rem;
    margin-top: 4rem;
    text-align: center;
}

.disclaimer-content {
    max-width: 800px;
    margin: 0 auto;
}

.disclaimer-content p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #666;
    margin-bottom: 1rem;
}

.disclaimer-content p:last-child {
    margin-bottom: 0;
}

/*
============================================
== NEW: MOBILE STYLES (860px and below)   ==
============================================
*/
@media (max-width: 860px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .main-container {
        padding: 0 1rem 1rem;
    }

    #desktop-benefits {
        display: none;
    }

    #mobile-benefits {
        display: flex;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
        padding: 0 1rem;
        /* Add padding to the content inside main */
    }

    .topbar #searchbox,
    .topbar #sort-by,
    .topbar #stats,
    .topbar .sub-header-topbar {
        flex-basis: auto;
        width: 100%;
        text-align: center;
    }

    /* --- NEW FIX: Force main content blocks to screen width --- */
    .filter-panel,
    main {
        width: 100vw;
        margin-left: -1rem;
        /* Counteract parent padding */
    }

    /* Add padding back to the direct children of the constrained containers */
    .filter-panel>details,
    #current-refinements,
    #hits,
    #pagination {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* <!-- MODIFIED: Responsive grid for mobile --> */
    .ais-Hits-list {
        grid-template-columns: 1fr;
        /* 1 column on mobile */
        gap: 1rem;
    }

    /* ▼▼▼ ADD THIS NEW RULE ▼▼▼ */
    .product-card {
        width: 100%;
    }

    /* --- NEW: Mobile styles for static homepage --- */
    .homepage-content h1 {
        font-size: 2rem;
    }

    .homepage-logo {
        display: none;
    }

    .homepage-description {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .homepage-features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .feature-card {
        padding: 1.5rem 1rem;
    }

    /* Mobile sizing for search bar */
    .search-container {
        height: 50px;
    }

    .search-input {
        font-size: 1rem;
        padding: 0 55px 0 1.25rem;
    }

    .search-button {
        width: 38px;
        right: 5px;
        top: 5px;
        bottom: 5px;
    }

    .search-button svg {
        width: 18px;
        height: 18px;
    }

    .homepage-search-input {
        height: 50px;
        font-size: 1rem;
        padding: 0 3rem 0 2.5rem;
        /* Keep room for nested button */
    }

    .homepage-search-icon {
        left: 0.75rem;
        font-size: 1rem;
    }

    /* Mobile sizing for homepage search button */
    .homepage-search-button {
        width: 38px;
        height: 38px;
        right: 0.4rem;
        font-size: 1rem;
    }

    /* --- NEW: Mobile styles for action buttons --- */
    .homepage-action-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        margin: 1.5rem 0 2rem 0;
    }

    .action-button {
        width: 100%;
        max-width: 280px;
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    /* --- NEW: Mobile styles for homepage products section --- */
    .homepage-products-section {
        margin: 3rem 0;
    }

    .homepage-products-section .homepage-products-heading {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .homepage-products-carousel {
        gap: 0.5rem;
        width: calc(100% + 2rem);
        margin-left: -1rem;
        margin-right: -1rem;
    }

    .carousel-nav {
        display: none;
    }

    .homepage-products-track {
        width: 100%;
        gap: 0.75rem;
        padding: 0.5rem 1rem;
    }

    .homepage-product-card {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .homepage-product-info {
        padding: 0.85rem;
    }

    .homepage-product-title {
        font-size: 0.95rem;
    }

    .homepage-product-description {
        font-size: 0.85rem;
    }

    /* --- Mobile styles for legal disclaimer --- */
    .legal-disclaimer {
        padding: 1.5rem 1rem;
        margin-top: 3rem;
    }

    .disclaimer-content p {
        font-size: 0.8rem;
    }
}

/*
============================================
== DESKTOP STYLES (861px and above)       ==
============================================
*/
@media (min-width: 861px) {
    #mobile-benefits {
        display: none;
    }
}

/* Ensure body has padding to account for the fixed category nav */
/* Note: When .has-header class is present, padding is handled by css/header.css */
body:not(.has-header) {
    padding-top: 60px;
}

/* Hide old mobile-category-nav when new header is active */
body.has-header .mobile-category-nav {
    display: none !important;
}

/* Search results padding */
#search-results {
    padding-top: 16px;
}

/* --- Hamburger Menu Button --- */
.filter-toggle-btn {
    display: none;
    /* Hidden by default on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--brand-green-dark);
    border-radius: 50%;
    transition: background-color 0.2s;
}

.filter-toggle-btn:hover {
    background-color: #f0f2f5;
}

/* --- Filter Panel (Desktop Default) --- */
.filter-panel {
    display: block;
}

.filter-header-mobile {
    display: none;
}

/* --- Mobile Responsive Styles --- */
@media (max-width: 860px) {
    .filter-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Filter Drawer */
    .filter-panel {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 100%;
        max-width: 320px;
        background: #fff;
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        padding: 0;
    }

    .filter-panel.open {
        transform: translateX(0);
    }

    .filter-header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid #eee;
        background: #f9f9f9;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .filter-header-mobile h2 {
        margin: 0;
        font-size: 1.2rem;
        color: var(--brand-green-dark);
    }

    .close-filters-btn {
        background: none;
        border: none;
        font-size: 2rem;
        line-height: 1;
        cursor: pointer;
        color: #666;
    }

    .filter-panel-content {
        padding: 1rem;
    }

    /* Overlay when filters are open */
    body.filters-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
    }

    /* Adjust layout grid for mobile */
    .layout {
        display: block;
    }
}

/* --- NEW: Full Width Layout Fixes --- */
/* Since #search-results is now outside .main-container */
#search-results {
    width: 100%;
}

.layout {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 0 2rem;
}

/* Mobile adjustments for layout padding */
@media (max-width: 860px) {
    .layout {
        padding: 0 0 1rem;
    }

    /* Reset the negative margins we added earlier since we now have a different structure */
    .filter-panel,
    main {
        width: auto;
        margin-left: 0;
    }

    /* But wait, if we want the filter panel to be a drawer, it needs fixed positioning which ignores this */
    /* The main content should be normal block */

    /* Re-apply padding to children if needed, but now .layout handles the container padding */
    .filter-panel>details,
    #current-refinements,
    #hits,
    #pagination {
        padding-left: 0;
        padding-right: 0;
    }
}

/* --- NEW: Mobile Sort Logic --- */
.mobile-sort-container {
    display: none;
    /* Hidden on desktop */
    margin-bottom: 1.5rem;
}

.mobile-sort-container h3 {
    margin-bottom: 0.5rem;
}

/* Mobile Styles */
@media (max-width: 860px) {

    /* Hide the topbar sort on mobile */
    .topbar #sort-by {
        display: none;
    }

    /* Show the mobile sort in the drawer */
    .mobile-sort-container {
        display: block;
    }

    /* Style the mobile sort select to look good in the drawer */
    .mobile-sort-container .ais-SortBy-select {
        width: 100%;
        height: 44px;
        border-radius: 8px;
        border: 1px solid #ccc;
        padding: 0 1rem;
        font-size: 1rem;
        background-color: #fff;
    }
}

/* --- Mobile Search Fixes --- */
@media (max-width: 860px) {
    /* Fix Header Gap & Movement */
    /* Enforce fixed height and alignment on category nav */
    .mobile-category-nav {
        height: 60px;
        padding: 0 1.5rem;
        /* Horizontal padding only */
        align-items: center;
        /* Vertically center the pills */
        box-sizing: border-box;
    }
}

/* --- Homepage Icon --- */
.homepage-icon {
    max-width: 100px;
    height: auto;
    margin-bottom: 1.5rem;
    display: inline-block;
}

/* ============================================
   NEW: Enhanced Product Card Styles
   ============================================ */

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-grid-item {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
}

/* Updated Product Card */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    text-decoration: none;
    color: var(--brand-text);
    transition: all 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--brand-green-light);
}

.product-card--sold-out {
    opacity: 0.85;
}

.product-card--sold-out .product-image img {
    filter: grayscale(30%);
}

/* Product Image Container */
.product-card .product-image {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background-color: #f9fafb;
    overflow: hidden;
}

.product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Sold Out Badge */
.product-sold-out-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #dc2626;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

/* Product Info Section */
.product-card .product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0.35rem;
}

/* Brand */
.product-brand {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Title */
.product-card .product-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--brand-green-dark);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
    transition: color 0.2s ease;
}

.product-card:hover .product-title {
    color: var(--brand-orange);
}

/* Star Rating */
.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 2px 0;
}

.product-stars {
    display: inline-flex;
    font-size: 0.9rem;
    line-height: 1;
}

.star {
    color: #fbbf24;
}

.star-full {
    color: #f59e0b;
}

.star-half {
    color: #f59e0b;
    opacity: 0.7;
}

.star-empty {
    color: #d1d5db;
}

.product-rating-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}

.product-review-count {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Price Row */
.product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

.product-card .product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #059669;
}

.product-card .product-supplier {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6b7280;
}

.no-results strong {
    color: var(--brand-green-dark);
}

/* Current Refinements */
.current-refinements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.current-refinement-item {
    display: inline-flex;
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    color: #166534;
}

.current-refinement-label {
    font-weight: 600;
    margin-right: 0.25rem;
}

.current-refinement-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: #166534;
    font-size: 1rem;
    padding: 0 0 0 0.5rem;
    line-height: 1;
}

.current-refinement-delete:hover {
    color: #dc2626;
}

/* Price Range Styling */
.price-range-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-range-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.price-range-submit {
    width: 32px;
    height: 32px;
    padding: 0;
    background-color: var(--brand-green-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.price-range-submit:hover {
    background-color: #2a4430;
}

/* Age Range Filter Styling */
.age-range-filter {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.age-range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.age-range-inputs label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.age-range-inputs label span {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.age-range-inputs input[type="number"] {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
}

.age-range-inputs input[type="number"]:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 2px rgba(127, 168, 122, 0.2);
}

.age-range-separator {
    color: #6b7280;
    font-size: 0.9rem;
    padding: 0 0.25rem;
}

.age-filter-apply {
    padding: 0.5rem 1rem;
    background-color: var(--brand-green-dark);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-left: 0.25rem;
}

.age-filter-apply:hover {
    background-color: #2a4430;
}

.age-quick-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.age-quick-pick {
    padding: 0.375rem 0.75rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}

.age-quick-pick:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.age-quick-pick.active {
    background: var(--brand-green);
    border-color: var(--brand-green);
    color: #fff;
}

.age-quick-pick.active:hover {
    background: var(--brand-green-dark);
    border-color: var(--brand-green-dark);
}

/* Toggle Refinement */
.ais-ToggleRefinement-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.ais-ToggleRefinement-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-green-dark);
}

/* Responsive adjustments */
@media (max-width: 860px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .product-card .product-info {
        padding: 0.75rem;
    }

    .product-card .product-title {
        font-size: 0.85rem;
    }

    .product-brand {
        font-size: 0.65rem;
    }

    .product-stars {
        font-size: 0.8rem;
    }

    .product-rating-text,
    .product-review-count {
        font-size: 0.7rem;
    }

    .product-card .product-price {
        font-size: 0.95rem;
    }

    .product-card .product-supplier {
        font-size: 0.65rem;
        max-width: 80px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   AMAZON-STYLE SEARCH RESULTS
   Conversion-optimized product card design
   ============================================ */

/* Container for Amazon-style results */
.ais-Hits-list.amazon-results,
#hits .ais-Hits-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Reset InstantSearch item wrapper */
.ais-Hits-item:has(.amazon-product-card) {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
}

/* Amazon Product Card - Grid Layout for proper button positioning */
.amazon-product-card {
    display: grid;
    grid-template-columns: 140px 1fr;
    grid-template-rows: auto auto;
    gap: 16px 16px;
    background: #fff;
    border-bottom: 1px solid #e7e7e7;
    padding: 16px;
    position: relative;
}

.amazon-product-card:first-child {
    border-top: 1px solid #e7e7e7;
}

.amazon-product-link {
    display: contents; /* Let children participate in parent grid */
    text-decoration: none;
    color: inherit;
}

/* Stretched link: Make entire card clickable via pseudo-element */
.amazon-product-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: pointer;
}

/* Product Image */
.amazon-product-image {
    grid-column: 1;
    grid-row: 1 / 3; /* Span both rows */
    width: 140px;
    height: 180px;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #fff;
}

.amazon-product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Sold Out Badge */
.amazon-sold-out-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: #cc0c39;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

.amazon-product-card--sold-out .amazon-product-image img {
    opacity: 0.6;
}

/* Product Details */
.amazon-product-details {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Product Title - Amazon Blue */
.amazon-product-title {
    font-size: 16px;
    font-weight: 400;
    color: #0F1111;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.amazon-product-link:hover .amazon-product-title {
    color: #C45500;
    text-decoration: underline;
}

/* Brand/Author */
.amazon-product-brand {
    font-size: 14px;
    color: #565959;
    margin: 0;
}

.amazon-product-brand a {
    color: #007185;
    text-decoration: none;
    /* Position above the stretched card link */
    position: relative;
    z-index: 2;
}

.amazon-product-brand a:hover {
    color: #C45500;
    text-decoration: underline;
}

/* Star Rating */
.amazon-product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.amazon-rating-value {
    font-size: 13px;
    font-weight: 600;
    color: #0F1111;
}

.amazon-stars {
    display: inline-flex;
    font-size: 14px;
    line-height: 1;
}

.amazon-stars .star {
    color: #FFA41C;
}

.amazon-stars .star-empty {
    color: #DDDDDD;
}

.amazon-stars .star-half {
    color: #FFA41C;
}

.amazon-review-count {
    font-size: 13px;
    color: #007185;
}

.amazon-review-count:hover {
    color: #C45500;
    text-decoration: underline;
    cursor: pointer;
}

/* Product Format */
.amazon-product-format {
    font-size: 13px;
    color: #565959;
    margin: 0;
}

/* Price Row */
.amazon-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.amazon-price {
    font-size: 20px;
    font-weight: 400;
    color: #0F1111;
}

.amazon-price sup {
    font-size: 12px;
    top: -6px;
}

.amazon-original-price {
    font-size: 14px;
    color: #565959;
    text-decoration: line-through;
}

/* Delivery Info */
.amazon-delivery-info {
    font-size: 13px;
    color: #565959;
    margin: 6px 0 0 0;
}

.amazon-delivery-info strong {
    color: #0F1111;
}

/* Prime Badge */
.amazon-prime-badge {
    display: inline-flex;
    align-items: center;
    background: #232F3E;
    color: #00A8E1;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 6px;
    letter-spacing: 0.5px;
}

.amazon-prime-badge::before {
    content: "✓";
    margin-right: 3px;
    font-size: 10px;
}

/* Add to Cart Button - Full width in details column, matches product page .btn-primary */
.amazon-add-to-cart-btn {
    /* Grid positioning: fill the details column */
    grid-column: 2;
    grid-row: 2;
    justify-self: stretch; /* Fill full width of column */
    margin-top: 0;

    /* Styling from product page .btn-primary */
    background: #c27455;
    border: none;
    border-radius: 9999px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.875rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-sizing: border-box;

    /* Position above the stretched card link */
    position: relative;
    z-index: 2;
}

.amazon-add-to-cart-btn:hover {
    background: #b06545;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(194, 116, 85, 0.3);
}

.amazon-add-to-cart-btn:active {
    background: #a05a3a;
    transform: translateY(0);
    box-shadow: none;
}

/* Filter Chips - Horizontal Scrollable */
.amazon-filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e7e7e7;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.amazon-filter-chips::-webkit-scrollbar {
    display: none;
}

.amazon-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #D5D9D9;
    border-radius: 20px;
    font-size: 13px;
    color: #0F1111;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.1s ease;
}

.amazon-filter-chip:hover {
    background: #F7FAFA;
    border-color: #c7cbcb;
}

.amazon-filter-chip.active {
    background: #EDFDFF;
    border-color: #007185;
    color: #007185;
}

.amazon-filter-chip svg {
    width: 14px;
    height: 14px;
}

.amazon-filter-chip .chip-emoji {
    font-size: 14px;
    line-height: 1;
}

.amazon-filter-chip .chip-count {
    font-size: 11px;
    color: #565959;
    font-weight: 400;
}

.amazon-filter-chip.active .chip-count {
    color: #007185;
}

/* Stats/Results Count */
.amazon-results-stats {
    padding: 12px 16px;
    font-size: 14px;
    color: #565959;
    border-bottom: 1px solid #e7e7e7;
    background: #fff;
}

.amazon-results-stats strong {
    color: #C45500;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .amazon-product-card {
        padding: 12px;
    }

    .amazon-product-link {
        gap: 12px;
    }

    .amazon-product-image {
        width: 110px;
        height: 140px;
    }

    .amazon-product-title {
        font-size: 14px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .amazon-product-brand {
        font-size: 12px;
    }

    .amazon-stars {
        font-size: 12px;
    }

    .amazon-review-count,
    .amazon-rating-value {
        font-size: 12px;
    }

    .amazon-price {
        font-size: 18px;
    }

    .amazon-delivery-info {
        font-size: 12px;
    }

    .amazon-product-card {
        grid-template-columns: 110px 1fr;
        gap: 12px 12px;
    }

    .amazon-product-image {
        width: 110px;
    }

    .amazon-add-to-cart-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 400px) {
    .amazon-product-card {
        grid-template-columns: 90px 1fr;
    }

    .amazon-product-image {
        width: 90px;
        height: 120px;
    }
}

/* Topbar adjustments for Amazon style - 3 column layout */
.amazon-topbar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid #e7e7e7;
    gap: 12px;
    min-height: 44px;
}

/* Topbar refinements column */
.amazon-topbar .topbar-refinements {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.amazon-topbar .topbar-refinements:empty {
    display: none;
}

.amazon-topbar .topbar-refinements .ais-CurrentRefinements {
    display: contents;
}

.amazon-topbar .topbar-refinements .ais-CurrentRefinements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    border: none;
}

.amazon-topbar .topbar-refinements .ais-CurrentRefinements-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #EDFDFF;
    border: 1px solid #007185;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    color: #007185;
}

.amazon-topbar .topbar-refinements .ais-CurrentRefinements-label {
    font-weight: 600;
}

.amazon-topbar .topbar-refinements .ais-CurrentRefinements-delete {
    background: none;
    border: none;
    color: #007185;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    line-height: 1;
}

.amazon-topbar .topbar-refinements .ais-CurrentRefinements-delete:hover {
    color: #C45500;
}

/* Topbar actions column (sort + filter button) */
.amazon-topbar .topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.amazon-topbar .ais-SortBy-select {
    padding: 8px 12px;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}

.amazon-topbar .ais-SortBy-select:hover {
    background: #f5f5f5;
}

/* Search results container */
#search-results.amazon-style {
    background: #EAEDED;
    padding-top: 0 !important;
}

#search-results.amazon-style .layout {
    background: #fff;
    max-width: 100%;
    padding: 0;
}

#search-results.amazon-style main {
    background: #fff;
}

/* Amazon Topbar - Filter Button */
.amazon-topbar .filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #F0F2F2;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    font-size: 13px;
    color: #0F1111;
    cursor: pointer;
    transition: all 0.1s ease;
}

.amazon-topbar .filter-toggle-btn:hover {
    background: #e7e9e9;
}

.amazon-topbar .filter-toggle-btn svg {
    width: 16px;
    height: 16px;
}

/* Amazon Style Sort Dropdown */
#search-results.amazon-style .ais-SortBy-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    font-size: 13px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E") no-repeat right 12px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    color: #0F1111;
}

#search-results.amazon-style .ais-SortBy-select:hover {
    background-color: #f5f5f5;
}

/* Amazon Style Stats */
#search-results.amazon-style #stats {
    font-size: 14px;
    color: #565959;
    padding: 0;
    background: none;
    border: none;
}

#search-results.amazon-style .ais-Stats-text {
    color: #565959;
}

/* Amazon Pagination */
.amazon-pagination {
    display: flex;
    justify-content: center;
    padding: 20px 16px;
    background: #fff;
    border-top: 1px solid #e7e7e7;
}

.amazon-pagination .ais-Pagination-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.amazon-pagination .ais-Pagination-item {
    margin: 0;
}

.amazon-pagination .ais-Pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    background: #fff;
    color: #0F1111;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.1s ease;
}

.amazon-pagination .ais-Pagination-link:hover {
    background: #F7FAFA;
    border-color: #c7cbcb;
}

.amazon-pagination .ais-Pagination-item--selected .ais-Pagination-link {
    background: #EDFDFF;
    border-color: #007185;
    color: #007185;
    font-weight: 600;
}

.amazon-pagination .ais-Pagination-item--disabled .ais-Pagination-link {
    color: #D5D9D9;
    cursor: not-allowed;
    background: #fff;
}

.amazon-pagination .ais-Pagination-item--disabled .ais-Pagination-link:hover {
    background: #fff;
    border-color: #D5D9D9;
}

/* Current Refinements - Amazon Style */
#search-results.amazon-style #current-refinements {
    padding: 0 16px;
    margin: 0;
}

#search-results.amazon-style .ais-CurrentRefinements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
    margin: 0;
    list-style: none;
    border-bottom: 1px solid #e7e7e7;
}

#search-results.amazon-style .ais-CurrentRefinements-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #EDFDFF;
    border: 1px solid #007185;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    color: #007185;
}

#search-results.amazon-style .ais-CurrentRefinements-label {
    font-weight: 600;
}

#search-results.amazon-style .ais-CurrentRefinements-delete {
    background: none;
    border: none;
    color: #007185;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    line-height: 1;
}

#search-results.amazon-style .ais-CurrentRefinements-delete:hover {
    color: #C45500;
}

/* Hide empty current refinements container and list */
#current-refinements:empty,
.ais-CurrentRefinements:empty,
.ais-CurrentRefinements-list:empty,
.current-refinements-list:empty,
.ais-CurrentRefinements--noRefinement,
.ais-CurrentRefinements--noRefinement .ais-CurrentRefinements-list {
    display: none;
}

/* Hide the old topbar in .layout for amazon style */
#search-results.amazon-style .layout .topbar {
    display: none;
}

/* Adjust layout for amazon style */
#search-results.amazon-style .layout {
    display: block;
    padding: 0;
}

#search-results.amazon-style .layout main {
    padding: 0;
}

#search-results.amazon-style #hits {
    padding: 0;
}

/* Mobile adjustments for amazon style */
@media (max-width: 860px) {
    .amazon-filter-chips {
        padding: 10px 12px;
        gap: 6px;
    }

    .amazon-filter-chip {
        padding: 6px 12px;
        font-size: 12px;
    }

    .amazon-topbar {
        grid-template-columns: 1fr auto;
        padding: 8px 12px;
        gap: 8px;
    }

    /* On mobile, refinements span full width on their own row */
    .amazon-topbar .topbar-refinements {
        grid-column: 1 / -1;
        order: 3;
    }

    .amazon-topbar .topbar-refinements:empty {
        display: none;
    }

    .amazon-topbar .filter-toggle-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    #search-results.amazon-style #stats {
        font-size: 12px;
    }

    /* Show filter button on left on mobile */
    .amazon-topbar .topbar-actions {
        order: -1;
    }
}

/* Desktop: Hide filter chips filter button on desktop when sidebar is visible */
@media (min-width: 861px) {
    #search-results.amazon-style .layout {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 0;
    }

    #search-results.amazon-style .filter-panel {
        display: block;
        border-right: 1px solid #e7e7e7;
        padding: 16px;
        background: #fff;
    }

    /* Main content area (topbar + results) */
    #search-results.amazon-style .main-content {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    #search-results.amazon-style .main-content .amazon-topbar {
        border-bottom: 1px solid #e7e7e7;
    }

    #search-results.amazon-style .main-content main {
        flex: 1;
    }

    .amazon-topbar .filter-toggle-btn {
        display: none;
    }
}

/* ============================================
   AMAZON DESKTOP LAYOUT
   Enhanced horizontal cards for desktop
   ============================================ */

/* Product Description - hidden on mobile, shown on desktop */
.amazon-product-description {
    display: none; /* Hidden by default on mobile */
    font-size: 14px;
    color: #565959;
    line-height: 1.5;
    margin: 8px 0 0 0;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Desktop-specific enhancements (861px+) */
@media (min-width: 861px) {
    /* Amazon-style large horizontal layout */
    .amazon-product-card {
        grid-template-columns: 220px 1fr;
        grid-template-rows: 1fr auto;
        gap: 0 28px;
        padding: 24px 28px;
        align-items: start;
    }

    .amazon-product-image {
        grid-row: 1 / 3;
        width: 220px;
        height: 280px;
        align-self: start;
    }

    .amazon-product-details {
        grid-column: 2;
        grid-row: 1;
        gap: 6px;
    }

    .amazon-product-title {
        font-size: 18px;
        font-weight: 400;
        line-height: 1.4;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        color: #0F1111;
    }

    .amazon-product-description {
        display: -webkit-box; /* Show on desktop */
        font-size: 14px;
        line-height: 1.6;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        color: #565959;
        margin: 8px 0 0 0;
    }

    .amazon-product-brand {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .amazon-product-brand a {
        color: #007185;
        text-decoration: none;
    }

    .amazon-product-brand a:hover {
        color: #C45500;
        text-decoration: underline;
    }

    .amazon-price {
        font-size: 24px;
        font-weight: 400;
    }

    .amazon-price-row {
        margin-top: 8px;
    }

    /* Button positioned in second row under details */
    .amazon-add-to-cart-btn {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
        align-self: start;
        width: auto;
        min-width: 180px;
        margin: 12px 0 0 0;
        padding: 12px 28px;
        font-size: 14px;
    }

    .amazon-product-rating {
        margin: 6px 0;
    }

    .amazon-stars {
        font-size: 15px;
    }

    .amazon-rating-value {
        font-size: 14px;
        font-weight: 600;
    }

    .amazon-review-count {
        font-size: 14px;
    }
}

/* Large desktop (1100px+) */
@media (min-width: 1100px) {
    .amazon-product-card {
        grid-template-columns: 240px 1fr;
        gap: 0 32px;
        padding: 28px 32px;
    }

    .amazon-product-image {
        width: 240px;
        height: 300px;
    }

    .amazon-product-title {
        font-size: 20px;
    }

    .amazon-price {
        font-size: 28px;
    }

    .amazon-add-to-cart-btn {
        min-width: 200px;
        padding: 14px 32px;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 860px) {
    .amazon-product-card {
        grid-template-columns: 160px 1fr;
        grid-template-rows: 1fr auto;
        gap: 0 20px;
        padding: 20px 24px;
    }

    .amazon-product-image {
        grid-row: 1 / 3;
        width: 160px;
        height: 200px;
    }

    .amazon-product-title {
        font-size: 16px;
    }

    .amazon-product-description {
        display: -webkit-box; /* Show on tablet */
        -webkit-line-clamp: 2;
        line-clamp: 2;
        font-size: 13px;
    }

    .amazon-add-to-cart-btn {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
        width: auto;
        min-width: 160px;
        margin: 10px 0 0 0;
    }
}

/* Mobile: Description hidden (display:none in base styles) */

/* ========================================
   SITE FOOTER
   ======================================== */

.site-footer {
    background: #fff;
    color: var(--brand-text);
    padding: 3rem 1.5rem 2rem;
    margin-top: 3rem;
    border-top: 1px solid #e5e5e5;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.footer-column {
    display: flex;
    flex-direction: column;
}

.footer-brand {
    grid-column: span 1;
}

.footer-logo img {
    margin-bottom: 1rem;
}

.footer-tagline {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 1rem 0;
    font-style: italic;
}

.footer-copyright {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 2rem;
    margin-top: 1rem;
    border-top: 1px solid #e5e5e5;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: var(--brand-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--brand-green);
    text-decoration: underline;
}

.footer-policy {
    color: #555;
    font-size: 0.9rem;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.footer-contact svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #888;
}

.footer-contact span {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Footer responsive */
@media (max-width: 900px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-brand {
        grid-column: span 2;
        text-align: center;
        margin-bottom: 1rem;
    }

    .footer-logo {
        display: inline-block;
    }
}

@media (max-width: 600px) {
    .site-footer {
        padding: 2rem 1rem 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        grid-column: span 1;
    }

    .footer-column {
        align-items: center;
    }

    .footer-contact li {
        justify-content: center;
    }

    .footer-contact span {
        text-align: left;
    }

    .footer-copyright {
        grid-column: 1;
        order: 10;
    }
}
