/* Cajú Coffee - Design System */
:root {
    /* Palette */
    --primary: #A47C60;
    --primary-rgb: 164, 124, 96;
    --secondary: #A3B18A;
    --secondary-rgb: 163, 177, 138;

    --bg-light: #FAFAF8;
    --bg-dark: #1C1916;

    --text-main: #171412;
    --text-muted: #5C534B;
    --text-light: #EAEAEA;

    /* Typography */
    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Noto Sans', sans-serif;

    /* Spacing & Layout */
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --container-width: 1200px;
}

/* Dark Mode Support (Class-based default) */
.dark {
    --bg-body: var(--bg-dark);
    --text-body: var(--text-light);
    --glass-bg: rgba(28, 25, 22, 0.65);
    --glass-border: rgba(255, 255, 255, 0.05);
}

:root {
    --bg-body: var(--bg-light);
    --text-body: var(--text-main);
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.3);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    width: 100%;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.1;
}

button {
    font-family: var(--font-display);
    cursor: pointer;
    border: none;
    background: none;
}

a {
    text-decoration: none;
}

/* Utilities */
.container {
    width: 100%;
    padding: 0 1rem;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .container {
        max-width: 1200px;
        padding: 0 2rem;
    }
}

/* Visual Effects */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.liquid-text {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(120deg, var(--text-body) 0%, var(--primary) 50%, var(--text-body) 100%);
    background-size: 200% auto;
    animation: liquidShine 5s linear infinite;
}

@keyframes liquidShine {
    to {
        background-position: 200% center;
    }
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Layout Specifics */
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(250, 250, 248, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    /* padding controlled by inner container */
}

.dark .header-bar {
    background: rgba(28, 25, 22, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-pill {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: all 0.2s;
    color: var(--text-body);
}

.nav-pill:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Desktop Nav */
.desktop-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-muted);
    position: relative;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* Hero Section (Rewritten for Full Width) */
.hero-section {
    padding-top: 4.5rem;
    /* space for header */
    width: 100%;
}

.hero-card {
    height: 65vh;
    width: 100%;
    /* Mobile: rounded */
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* On Desktop, Hero is full bleed edge-to-edge if user wants, or we keep radius?
   User said "Like the cover, let's make better use of spaces". 
   Usually full width means no radius on sides. */

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

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

.overlay-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), transparent, rgba(0, 0, 0, 0.3));
    pointer-events: none;
}

.badge-new {
    background: rgba(163, 177, 138, 0.2);
    color: #3f4a30;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    border: 1px solid rgba(163, 177, 138, 0.3);
    backdrop-filter: blur(4px);
}

.dark .badge-new {
    color: var(--secondary);
}

.btn-primary {
    width: 100%;
    height: 3rem;
    background-color: var(--primary);
    color: white;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
    box-shadow: 0 4px 6px -1px rgba(164, 124, 96, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:hover {
    background-color: #8e6b52;
}

/* Products */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3rem 0 1.5rem 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    /* Smaller min-width for mobile compact */
    gap: 1rem;
    /* Reduced gap */
    padding-bottom: 2rem;
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }
}

.product-card {
    width: 100%;
    border-radius: var(--radius-lg);
    background: var(--bg-body);
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

/* Accordion Styles */
details {
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: all 0.3s ease;
}

details[open] {
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

summary {
    list-style: none;
    padding: 1.25rem;
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

summary::-webkit-details-marker {
    display: none;
}

summary:hover {
    background: rgba(0, 0, 0, 0.02);
}

summary .icon-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

summary .chevron {
    transition: transform 0.3s ease;
}

details[open] summary .chevron {
    transform: rotate(180deg);
}

details .content {
    padding: 0 1.25rem 1.25rem 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-img-box {
    height: 220px;
    width: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.fav-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.fav-btn:hover {
    transform: scale(1.1);
}

.fav-btn span {
    font-size: 1.125rem;
}

.card-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--bg-body);
}

.price-tag {
    color: var(--secondary);
    font-weight: 700;
    font-size: 1.125rem;
}

.action-btn {
    width: 100%;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: #F4F2F0;
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: background 0.2s;
}

.action-btn:hover {
    background: #EAE6E3;
}

/* Footer (Full Width) */
.main-footer {
    width: 100%;
    background: var(--bg-dark);
    color: white;
    margin-top: 4rem;
    padding: 4rem 0 8rem 0;
    /* Increased bottom padding for mobile/bottom-nav clearance */
    /* Reset radius for full bleed */
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: env(safe-area-inset-bottom, 1rem);
    padding-top: 0.5rem;
}

.nav-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 480px;
    /* Limit nav width on mobile */
    margin: 0 auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: #9CA3AF;
    width: 4rem;
    padding: 0.5rem;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:hover {
    color: var(--text-body);
}

.nav-label {
    font-size: 0.625rem;
    font-weight: 700;
}

.fab-main {
    position: relative;
    top: -1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(164, 124, 96, 0.4);
    border: 4px solid var(--bg-body);
    transition: transform 0.2s;
}

/* Animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.5, 0, 0, 1), transform 0.8s cubic-bezier(0.5, 0, 0, 1);
    will-change: opacity, transform;
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-1 {
    transition-delay: 100ms;
}

.stagger-2 {
    transition-delay: 200ms;
}

.stagger-3 {
    transition-delay: 300ms;
}


/* --- DESKTOP MEDIA QUERY (Rewritten) --- */
@media (min-width: 768px) {
    .header-bar {
        padding: 1.5rem 0;
        /* Let container handle side padding */
    }

    .hero-section {
        padding-top: 6rem;
    }

    .hero-card {
        height: 70vh;
        /* Taller on desktop */
        border-radius: 0;
        /* Full bleed */
        box-shadow: none;
    }

    /* Glass card placement on Desktop - Left aligned */
    .hero-card .glass-panel {
        left: 10% !important;
        bottom: 20% !important;
        align-items: flex-start !important;
        text-align: left !important;
        max-width: 450px !important;
        width: auto !important;
    }

    .scroll-row {
        flex-wrap: wrap;
        justify-content: center;
        overflow-x: visible;
        padding-left: 0;
    }

    .product-card {
        width: 260px;
        /* Slightly larger cards */
    }

    /* Story section Layout */
    .story-section>div {
        flex-direction: row;
        padding: 3rem !important;
        max-width: 100%;
        /* Fill container */
    }

    /* Navigation */
    .bottom-nav {
        display: none;
    }

    .header-bar .nav-pill {
        display: none;
    }

    .desktop-nav {
        display: flex !important;
    }

    .main-footer {
        padding-bottom: 4rem;
        /* Standard padding on desktop (no bottom nav) */
    }
}

/* --- Mobile Menu Overlay --- */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    justify-content: flex-start;
}

.mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

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

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.mobile-link {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.mobile-link:hover {
    color: var(--primary);
}

/* --- Floating Elements --- */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 1.875rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    z-index: 200;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.5s ease;
    flex-wrap: wrap;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner a {
    color: var(--secondary);
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 5rem;
        /* Above bottom nav */
        right: 1rem;
        width: 3rem;
        height: 3rem;
    }
}

/* --- Legal Pages Layout --- */
.legal-container {
    height: 100vh;
    /* Fixed height to viewport */
    display: flex;
    flex-direction: column;
    padding-top: 5.5rem;
    /* Clear fixed header */
    padding-bottom: 3rem;
    /* Space from bottom edge - Restored */
    overflow: hidden;
    /* Prevent outer scroll */
}

.legal-content {
    flex: 1;
    overflow-y: auto;
    /* Internal scroll */
    padding: 1rem 1rem 2rem 1rem;
    max-width: 800px;
    /* Readability improvement */
    margin: 0 auto;
    width: 100%;
}

.legal-container .btn-primary {
    margin-top: 3rem;
    align-self: center;
    width: auto;
    padding: 0 2rem;
    flex-shrink: 0;
}/* --- Shopping Cart --- */
.cart-floating-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(164, 124, 96, 0.4);
    z-index: 99;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid white;
}

.cart-floating-btn:hover {
    transform: scale(1.1);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF4D4D;
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Cart Drawer */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.cart-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    background: var(--bg-body);
    z-index: 101;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.cart-drawer.open {
    transform: translateX(0);
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-body);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark .cart-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-item-img {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    object-fit: cover;
    background-color: #f0f0f0;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-main);
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #E5E7EB;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: var(--bg-body);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Adjust floating button for mobile bottom nav */
@media (max-width: 768px) {
    .cart-floating-btn {
        bottom: 5.5rem;
        /* Above bottom nav */
        right: 1rem;
        width: 3rem;
        height: 3rem;
    }
}
