/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Design tokens (CSS variables) */
:root {
    --bg-page: #FDF1EC;
    --text-default: #333333;
    --muted: rgba(0,0,0,0.02);
    --accent: #000000;
    --max-width: none;
    --side-left-width: 350px;
    --side-right-width: 400px;
    --gutter: 2rem;
    --padding-large: 4rem;
    /* Use @font-face family names */
    --font-display: 'Neutra Display', sans-serif; /* weights: 100, 300, 500, 700 */
    --font-body: 'Neutra Text', sans-serif;       /* weights: 300 (Light), 500 (Book) */
    --font-body-light: 'Neutra Text', sans-serif;
    --ink: #1a1a1a;
    --ink-muted: #5b5b5b;
    --border: rgba(0,0,0,0.12);
    /* Intro collage sizing */
    --intro-art-center-h: 480px; /* height of the middle collage image on desktop */
}

/* ====================
   Base
   ==================== */

body {
    font-family: var(--font-body);
    font-weight: 300; /* prefer Light for body copy */
    line-height: 1.6;
    overflow-x: hidden;
    color: var(--text-default);
    background-color: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth; /* smooth scroll for anchor links */
}

/* Typography */
h1 {
    font-family: var(--font-display);
    font-size: 4rem;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500; /* use Display Medium */
}

h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500; /* use Display Medium */
}

.subtitle {
    font-family: var(--font-body);
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

/* Layout containers */
.main-header {
    width: 100%;
    position: relative;
}

/* Centered logo above the menu */
.logo-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px; /* reserve vertical space for the logo (updated) */
}
.nav-center-logo {
    position: relative;
    z-index: 50;
}
.nav-center-logo img {
    display: block;
    height: 144px; /* doubled size */
}

/* Ensure ingredients page logo matches index size */
.logo-wrapper img.site-logo {
    display: block;
    height: 144px;
    width: auto;
}

/* Top menu (duplicate of footer menu) placed under the centered logo */
.top-footer-menu {
    text-align: center;
    /* spacing between logo and menu now controlled by logo-wrapper height */
    margin-top: 0;
    padding-top: 20px; /* add top padding */
    padding-bottom: 20px; /* reduced bottom padding to better match spacing */
    position: relative; /* allow mobile gradient fades */
}
.top-footer-menu ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    align-items: center;
    padding: 0;
    margin: 0;
}
.top-footer-menu ul li {
    font-family: var(--font-display);
    font-size: 0.95rem;
}
.top-footer-menu a { text-decoration: none; color: var(--accent); }
.top-footer-menu ul li:not(:last-child)::after {
    content: '';
    display: inline-block;
    width: 4rem;
    height: 1px;
    background: var(--muted);
    margin-left: 1rem;
    vertical-align: middle;
}

/* Make top and footer menu items uppercase to match mockup style */
.top-footer-menu a,
.footer-menu a {
    text-transform: uppercase;
    letter-spacing: 0;
}

/* Banner uses background-image; JS will set a random image from img-header */
.banner {
    width: 100%;
    height: 80vh; /* use 80% of viewport height */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    margin-bottom: 50px; /* space between banner and next module */
}

.pre-banner-text {
    text-align: center;
    font-family: var(--font-display);
    font-size: 2.5rem;
    margin-bottom: 20px; /* 20px before the banner image */
}

/* Products section */
.products-section {
    display: flex;
    align-items: stretch; /* make child columns match height */
    gap: var(--gutter);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--padding-large) 2rem;
    padding-top: 20px;
    background-color: var(--bg-page);
    text-align: center;
}

.brand-title {
    font-family: var(--font-display);
    text-align: center;
    margin-bottom: 0rem;
    font-size: 2.5rem;
    /* letter-spacing: 0.1em; */
}

.main-footer {
    width: 100%;
    background: var(--muted);
}

/* ====================
   Components
   (product menu, product display, description)
   ==================== */

/* Responsive design */
@media (max-width: 1024px) {
    .products-section {
        grid-template-columns: 200px 1fr 250px;
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .products-section {
        grid-template-columns: 1fr;
    }
}

/* --- Merged enhanced-styles.css content --- */

/* Product Menu Enhanced Styles */
.product-menu li {
    position: relative;
    cursor: pointer;
    padding-bottom: 40px;
    padding-top: 40px;
    list-style-type: none;
    border-bottom: 1px solid var(--accent);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* remove bottom border for the last menu item */
.product-menu li:last-child {
    border-bottom: none;
}

/* Three-column widths for desktop */
.side-menu {
    width: var(--side-left-width);
    flex: 0 0 var(--side-left-width);
    /* show ~12 items max vertically, enable scrolling for overflow */
    max-height: calc(12 * (40px + 40px)); /* using current li padding-top/bottom */
    overflow-y: auto;
}

/* Thin 2px black scrollbar for side-menu */

/* Scrollbar styles: hidden by default, visible when hovering the side-menu */
.side-menu::-webkit-scrollbar { width: 2px; }
.side-menu::-webkit-scrollbar-track { background: transparent; }
.side-menu::-webkit-scrollbar-thumb { background: transparent; border-radius: 1px; }

/* Show thumb on hover */
.side-menu:hover::-webkit-scrollbar-thumb { background: #000; }

/* Firefox: thin + make visible only on hover using color change */
.side-menu { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.side-menu:hover { scrollbar-color: #000 transparent; }

.product-content {
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.product-content .product-display {
    width: 100%;
    height: auto;
    align-self: stretch; /* stretch to match siblings */
}

.product-description {
    width: var(--side-right-width);
    flex: 0 0 var(--side-right-width);
}

.product-menu li:hover {
    /* removed background on hover for a cleaner look per design */
    background-color: transparent;
}

.menu-indicator {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-menu li.active .menu-indicator {
    background-color: #e88756; /* updated active indicator color */
    transform: translateY(-50%) scale(1.1);
}

.product-info {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-info {
    padding: 0 20px; /* horizontal breathing room */
}

.product-info h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    /* letter-spacing: 0.05em; */
    transition: color 0.3s ease;
}

.product-subtitle {
    font-family: var(--font-body);
    font-size: 1rem;
    color: #666;
    margin: 0 0 0.3rem 0;
    /* no forced uppercase for body copy */
}

.product-menu li:hover .product-info h3 {
    color: var(--accent);
}

/* Product Display Enhanced Styles */
.product-display {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 300px; /* safe fallback */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    transition: background-image 300ms ease, transform 300ms ease, box-shadow 300ms ease;
}

.product-display:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* Right Panel Enhanced Styles */
.product-description {
    padding: 1.5rem;
    border-radius: 0px;
    border: solid 1px var(--accent);
    transition: all 0.3s ease;
}

.description-container {
    max-width: 350px;
    margin: 0 auto; /* center within the right panel */
}

/* Right panel: all copy in big caps */
.product-description h2 { text-transform: uppercase; }

.product-description h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin: 0 0 1.5rem 0;
    /* letter-spacing: 0.1em; */
}

.properties-text,
.ingredients-text {
    font-family: var(--font-body);
    /* match menu item title font-size */
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    color: var(--text-default);
    transition: color 0.3s ease, transform 0.3s ease;
    text-transform: none; /* body copy should not be uppercase */
    /* letter-spacing: 0.06em; */
}

/* Ensure usage copy is also normal case */
.usage-text { text-transform: none; }

.buy-button {
    display: inline-block;
    width: 100%;
    padding: 1rem;
    background-color: var(--accent);
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    margin-top: 2.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--accent);
}

.buy-button:hover {
    background-color: #fff;
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Secondary Amazon button: inverted style, 20px below main */
.buy-button-secondary {
    background-color: #fff;
    color: var(--accent);
    border-color: var(--accent);
    margin-top: 20px; /* 20px below the primary button */
}
.buy-button-secondary:hover {
    background-color: var(--accent);
    color: #fff;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 1200px) {
    .products-section {
        display: flex;
        align-items: stretch;
        gap: 1.5rem;
        padding: 2rem;
    }
    
    .product-display {
        max-width: 400px;
    }
}

@media (max-width: 992px) {
    .products-section {
        /* stack columns vertically on tablets/phones */
        flex-direction: column;
        gap: 3rem;
    }
    /* Ensure stacked sections take full width and render height */
    .product-content { width: 100%; display: block; }
    .product-description { width: 100%; flex: 0 0 auto; }
    
    .product-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .product-menu li {
        flex: 1 1 calc(50% - 1rem);
        border: 1px solid rgba(0,0,0,0.1);
        border-radius: 4px;
        padding: 1rem 1rem 1rem 2.5rem;
    }
    
    .product-display {
        max-width: 100%;
        aspect-ratio: 16/9;
    }

    /* Make top and footer menus horizontally scrollable with momentum */
    .top-footer-menu ul,
    .footer-menu ul {
        justify-content: flex-start;
        gap: 1.25rem;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch; /* iOS momentum + bounce */
        scroll-snap-type: x proximity;
        padding: 0 1rem;
        margin: 0; /* reset bottom margin for better scroll */
        scrollbar-width: none; /* Firefox hide scrollbar */
        -ms-overflow-style: none; /* IE/Edge hide scrollbar */
    }
    .top-footer-menu ul li,
    .footer-menu ul li {
        flex: 0 0 auto;
        scroll-snap-align: center;
    }
    /* Hide separators for cleaner horizontal scroll */
    .top-footer-menu ul li:not(:last-child)::after,
    .footer-menu ul li:not(:last-child)::after { display: none; }

    /* Hide scrollbars (WebKit) */
    .top-footer-menu ul::-webkit-scrollbar,
    .footer-menu ul::-webkit-scrollbar { display: none; height: 0; }
}

@media (max-width: 768px) {
    /* Product selector becomes horizontal scroll chips */
    .side-menu {
        width: 100%;
        flex: 1 1 auto;
        max-height: none;
        overflow: visible;
        margin-bottom: 0.5rem;
    }
    .product-menu {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.75rem;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding: 0 1rem 0.5rem;
        margin-bottom: 1rem;
    }
    .product-menu li {
        flex: 0 0 auto;
        min-width: 220px;
        border: 1px solid rgba(0,0,0,0.2);
        border-radius: 6px;
        padding: 0.75rem 1rem;
        scroll-snap-align: center;
    }
    .product-info h3 { font-size: 0.95rem; }
    .product-subtitle { display: none; }
    
    .product-description {
        padding: 1.5rem;
        width: 100%;
        flex: 1 1 auto;
    }
    
    .properties-text,
    .ingredients-text {
        /* keep same sizing on small screens as desktop menu title */
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 2rem;
    }

    /* Taller product image on small screens for better visibility */
    .product-display { aspect-ratio: 4/5; min-height: 300px; }
}

/* --- End merged content --- */

/* Footer gallery and menu */
.main-footer {
    padding: 3rem 2rem 4rem;
    background: var(--bg-page);
}

.footer-gallery .gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    max-width: var(--max-width);
    margin: 0 auto 2rem;
}

.footer-gallery .gallery-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.footer-title {
    font-family: var(--font-display);
    font-size: 2.5rem; /* same as brand title */
    text-align: center;
    margin: 0 0 1.25rem 0;
}

/* Lightbox styles */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-content {
    /* Constrain content to viewport with breathing room so images always fit */
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    /* Ensure the image always fits inside the content box */
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    border-radius: 2px;
    object-fit: contain;
    margin: 0 auto;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
}

.lightbox-close { top: 1rem; right: 1rem; transform: none; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }


.footer-menu {
    text-align: center;
    margin-top: 100px;
    position: relative; /* allow mobile gradient fades */
}

/* Footer logo (old brand mark moved to footer) */
.footer-logo {
    text-align: center;
    margin: 1.5rem 0 0.5rem;
}
.footer-logo img {
    height: 112px;
    width: auto;
    display: inline-block;
}

.footer-menu ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    align-items: center;
    padding: 0;
    margin: 0 0 0.75rem 0;
}

.footer-menu ul li {
    font-family: var(--font-display);
    font-size: 0.95rem;
}

.footer-menu ul li:not(:last-child)::after {
    content: '';
    display: inline-block;
    width: 4rem;
    height: 1px;
    background: var(--muted);
    margin-left: 1rem;
    vertical-align: middle;
}

.footer-menu a {
    color: var(--accent);
    text-decoration: none;
}

.copyright {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.5rem;
}

@media (max-width: 992px) {
    .footer-gallery .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .footer-gallery .gallery-grid img {
        height: 140px;
    }

    /* Edge gradient fades to hint scrollability on mobile */
    .top-footer-menu::before,
    .top-footer-menu::after,
    .footer-menu::before,
    .footer-menu::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 28px;
        pointer-events: none;
        z-index: 5;
    }
    .top-footer-menu::before,
    .footer-menu::before { left: 0; background: linear-gradient(to right, var(--bg-page) 60%, rgba(253,241,236,0)); }
    .top-footer-menu::after,
    .footer-menu::after { right: 0; background: linear-gradient(to left, var(--bg-page) 60%, rgba(253,241,236,0)); }
}

/* Footer logo smaller on mobile */
@media (max-width: 640px) {
    .footer-logo img { height: 56px; }
    .footer-logo { margin: 1rem 0 0.25rem; }
}

/* ===============
   Ingredients page
   =============== */
.extra-intro {
    padding: 4rem 1.5rem 2rem;
    text-align: center;
}
.extra-intro .intro-title {
    font-family: var(--font-display);
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-align: center;
}
.extra-intro .intro-lead {
    max-width: 820px;
    margin: 0.5rem auto 1rem;
    font-family: var(--font-body-light);
    color: var(--ink-muted);
    text-align: center;
}
.extra-intro .intro-copy {
    max-width: 780px;
    margin: 0.5rem auto 0;
    text-align: center;
}
.extra-intro .intro-copy p { margin: 0.5rem 0; }

/* Intro decorative collage inspired by template image */
.intro-art {
    position: relative;
    height: calc(var(--intro-art-center-h) + 50px); /* center image height + 50px */
    margin-top: 2rem;
}
.intro-art img {
    position: absolute;
    width: 220px;
    height: 220px;
    object-fit: cover;
    box-shadow: none; /* drop shadow removed per request */
}
.intro-art .i1 { left: 10%; top: 35%; transform: rotate(-8deg); }
/* Center image switched to portrait and made taller */
.intro-art .i2 { left: 40%; top: 0%; width: 300px; height: var(--intro-art-center-h); transform: rotate(10deg); z-index: 2; }
.intro-art .i3 { right: 12%; top: 32%; width: 180px; height: 180px; transform: rotate(-4deg); }

@media (max-width: 900px) {
    :root { --intro-art-center-h: 340px; }
    .intro-art .i2 { width: 220px; height: var(--intro-art-center-h); }
    .intro-art .i1 { left: 2%; }
    .intro-art .i3 { right: 2%; }
}
@media (max-width: 640px) {
    .intro-art { height: auto; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 1.25rem; }
    .intro-art img { position: static; width: 100%; height: 140px; transform: none; box-shadow: none; }
}

.ingredients-section { padding: 1rem 1.5rem 4rem; }
.ingredients-section .container { max-width: 980px; margin: 0 auto; }

.accordion { border-top: 1px solid var(--border); }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-toggle {
    width: 100%;
    text-align: center; /* center headings */
    background: transparent;
    border: 0;
    padding: 1.2rem 0.75rem;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 2.5rem; /* match title size from index */
    letter-spacing: 0.02em;
}
.accordion-toggle[aria-expanded="true"] { color: var(--accent); }
.accordion-panel { padding: 0 0.75rem 1.25rem; text-align: center; border: 1px solid #000; }
.accordion-body { font-family: var(--font-body); color: var(--ink); max-width: 820px; margin: 0.5rem auto 0; }
.accordion-body p { margin: 0.5rem 0; }
.accordion-body h4 {
    /* Match .product-description h2 */
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin: 0 0 1.5rem 0;
}
.accordion-error { color: #a00; padding: 1rem; font-family: var(--font-body); }

/* Uppercase for titles (keep body copy normal case) */
.intro-title,
.footer-title,
.brand-title,
.pre-banner-text,
.product-info h3,
.accordion-toggle,
.accordion-body h4 { text-transform: uppercase; }

/* Lists centered as a block while keeping left alignment for readability */
.accordion-body ul { margin: 0.5rem auto; padding-left: 0; list-style-position: inside; text-align: center; }
.accordion-body li { text-align: center; }

@media (max-width: 768px) {
    .accordion-toggle { font-size: 1.7rem; }
}

/* ===============
   Beyond the Visible page
   =============== */
.btv-page { padding: 2rem 1rem 4rem; }
.btv-block { max-width: 980px; margin: 0 auto 3rem; text-align: center; }
.btv-title { font-family: var(--font-display); font-size: 2.2rem; margin-bottom: 1rem; text-transform: uppercase; }
.btv-body { font-family: var(--font-body); max-width: 820px; margin: 0 auto 50px; text-transform: none; }
.btv-image { width: 100%; height: auto; max-width: 100%; display: block; margin: 0 auto; }
