/* ============================================================
   PostMeMeds — Modern Herbal & Pharmacy Storefront
   Theme values are injected as CSS custom properties from admin.
   ============================================================ */

* { box-sizing: border-box; }

html { scroll-padding-top: 90px; }

body {
    margin: 0;
    font-family: var(--font-family, 'Plus Jakarta Sans', system-ui, sans-serif);
    background: var(--color-bg, #f6f7f2);
    color: var(--color-text, #17352c);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

h1, h2, h3, h4 {
    font-family: 'Fraunces', Georgia, serif;
    line-height: 1.15;
    margin: 0 0 .4em;
    color: var(--color-secondary, #0c3b2e);
}

a { color: var(--color-primary, #1b9e6f); text-decoration: none; transition: color .2s; }
a:hover { color: var(--color-primary-dark, #0c4a34); }

img { max-width: 100%; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* Animate every section that opts in */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

.full-bleed {
    width: auto;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* ============================================================
   ANNOUNCEMENT MARQUEE
   ============================================================ */
.announcement-bar {
    background: linear-gradient(90deg, var(--color-primary-dark, #0c4a34), var(--color-primary, #1b9e6f));
    color: #fff;
    overflow: hidden;
    position: relative;
    z-index: 60;
    padding: 9px 0;
}
.announcement-track {
    display: flex;
    width: max-content;
    animation: marquee var(--marquee-duration, 28s) linear infinite;
}
.announcement-group {
    display: flex;
    align-items: center;
    white-space: nowrap;
}
.announcement-item {
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .4px;
    padding: 0 12px;
}
.announcement-sep { color: var(--color-accent, #f6b01e); }
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-33.333%); }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 14px 0;
    transition: background .3s, box-shadow .3s, padding .3s;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(12, 59, 46, .08);
}
.site-header.scrolled {
    padding: 8px 0;
    box-shadow: 0 8px 30px rgba(12, 59, 46, .10);
    background: rgba(255, 255, 255, .94);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 40px; width: auto; }
.brand-name {
    font-family: 'Fraunces', serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--color-secondary, #0c3b2e);
    letter-spacing: -.3px;
}
.main-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.main-nav a {
    color: var(--color-secondary, #0c3b2e);
    font-weight: 600;
    font-size: .95rem;
    padding: 8px 14px;
    border-radius: 999px;
    position: relative;
}
.main-nav a:hover { color: var(--color-primary, #1b9e6f); background: rgba(27, 158, 111, .08); }
.main-nav a.active { color: var(--color-primary, #1b9e6f); background: rgba(27, 158, 111, .10); }
.main-nav a.active::after {
    content: '';
    position: absolute;
    left: 14px; right: 14px; bottom: 4px;
    height: 3px;
    border-radius: 3px;
    background: var(--color-accent, #f6b01e);
}
.main-nav .nav-cta { color: #fff; }

.cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 4px;
    border-radius: 999px;
    background: var(--color-accent, #f6b01e);
    color: #17352c;
    font-size: .75rem;
    font-weight: 800;
    vertical-align: middle;
}
.cart-icon-mobile { position: relative; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 24px; height: 2.5px; border-radius: 2px; background: var(--color-secondary, #0c3b2e); transition: transform .3s, opacity .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ============================================================
   PAGE
   ============================================================ */
.page-main { min-height: 62vh; padding: 34px 0 80px; }
.page-head { margin-bottom: 26px; }
.page-title { font-size: 2.1rem; }
.section-eyebrow {
    display: inline-block;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--color-primary, #1b9e6f);
    margin-bottom: 10px;
}
.section-title { font-size: 2rem; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: var(--radius, 16px);
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    font-size: .95rem;
    background: #e5e7eb;
    color: #111;
    transition: transform .18s ease, box-shadow .18s ease, background .2s, color .2s;
    text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary, #1b9e6f), var(--color-primary-dark, #0c4a34));
    color: #fff;
    box-shadow: 0 10px 22px -8px rgba(15, 122, 85, .55);
}
.btn-primary:hover { box-shadow: 0 14px 30px -8px rgba(15, 122, 85, .7); }
.btn-accent {
    background: linear-gradient(135deg, #f8cf5c, var(--color-accent, #f6b01e));
    color: #3a2a00;
    box-shadow: 0 10px 24px -8px rgba(214, 150, 20, .6);
}
.btn-accent:hover { box-shadow: 0 14px 30px -8px rgba(214, 150, 20, .75); }
.btn-whatsapp {
    background: linear-gradient(135deg, #3fd86f, #25d366);
    color: #fff;
    box-shadow: 0 10px 24px -8px rgba(37, 211, 102, .6);
}
.btn-whatsapp:hover { box-shadow: 0 14px 30px -8px rgba(37, 211, 102, .75); color: #fff; }
.btn.btn-whatsapp { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.btn-whatsapp svg { flex: 0 0 auto; }
.product-body .btn.btn-whatsapp { margin-top: 10px; }
.btn-ghost {
    background: rgba(255, 255, 255, .14);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, .55);
    backdrop-filter: blur(4px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.btn-outline {
    background: transparent;
    color: var(--color-primary, #1b9e6f);
    border: 2px solid var(--color-primary, #1b9e6f);
}
.btn-outline:hover { background: var(--color-primary, #1b9e6f); color: #fff; }
.btn-danger { background: #e05252; color: #fff; }
.btn-danger:hover { box-shadow: 0 10px 22px -8px rgba(224, 82, 82, .6); }
.btn-sm { padding: 8px 15px; font-size: .85rem; }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ============================================================
   ALERTS + TOASTS
   ============================================================ */
.alert { padding: 13px 18px; border-radius: var(--radius, 16px); margin-bottom: 16px; font-weight: 600; }
.alert-success { background: #d9f4e3; color: #0b6b42; border: 1px solid #b6e7cb; }
.alert-error { background: #fde5e5; color: #a02424; border: 1px solid #f6c6c6; }
.alert-info { background: #dceefb; color: #16537e; border: 1px solid #c0dcf2; }

.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: var(--color-secondary, #0c3b2e);
    color: #fff;
    padding: 14px 20px;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: .92rem;
    animation: toastIn .35s ease;
}
.toast.success { border-left: 4px solid #5ee0a4; }
.toast.error { border-left: 4px solid #ff7b7b; }
.toast .toast-icon { font-size: 1.2rem; }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(16px); } }

/* ============================================================
   HERO SLIDER
   ============================================================ */
.hero {
    position: relative;
    height: 80vh;
    min-height: 600px;
    max-height: 820px;
    overflow: hidden;
}
.page-main > .hero:first-child { margin-top: -34px; }
.hero-slider { position: absolute; inset: 0; }
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    background-size: 112%;
    background-position: center 25%;
    background-repeat: no-repeat;
    transition: opacity 1s ease, background-size 6s ease;
    overflow: hidden;
}
.hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.hero-slide.active { opacity: 1; background-size: 100%; }
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(8, 40, 29, .78) 0%, rgba(8, 40, 29, .45) 45%, rgba(8, 40, 29, .12) 100%);
}
.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    color: #fff;
    max-width: 1240px;
    z-index: 5;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .3);
    backdrop-filter: blur(6px);
    color: #fff;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 20px;
    animation: fadeUp 1s .15s ease both;
}
.hero-title {
    font-size: clamp(2.4rem, 6vw, 4.3rem);
    color: #fff;
    max-width: 18ch;
    animation: fadeUp 1s .3s ease both;
}
.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 46ch;
    margin: 16px 0 30px;
    color: rgba(255, 255, 255, .9);
    animation: fadeUp 1s .45s ease both;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; animation: fadeUp 1s .6s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

.hero-dots {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 6;
}
.hero-dot {
    width: 12px; height: 12px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, .4);
    cursor: pointer;
    transition: all .3s;
    padding: 0;
}
.hero-dot.active { width: 34px; background: #fff; }

/* ============================================================
   CATEGORY STRIP
   ============================================================ */
.category-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-top: -34px;
    position: relative;
    z-index: 8;
}
.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, hsl(var(--cat-hue, 145) 70% 96%), hsl(calc(var(--cat-hue, 145) + 45) 72% 91%));
    border: 2px solid hsl(var(--cat-hue, 145) 60% 84%);
    padding: 10px 20px 10px 10px;
    border-radius: 999px;
    box-shadow: 0 12px 30px -12px hsla(var(--cat-hue, 145), 55%, 40%, .45);
    font-weight: 700;
    color: var(--color-secondary, #0c3b2e);
    transition: transform .25s, box-shadow .25s;
}
.category-chip:hover { transform: translateY(-5px) scale(1.03); box-shadow: 0 20px 44px -14px hsla(var(--cat-hue, 145), 60%, 40%, .6); color: var(--color-secondary, #0c3b2e); }
.category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    font-size: 1.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, hsl(var(--cat-hue, 145) 70% 52%), hsl(calc(var(--cat-hue, 145) + 45) 72% 40%));
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .45), 0 6px 14px -6px hsla(var(--cat-hue, 145), 60%, 45%, .7);
    animation: catFloat 3.2s ease-in-out infinite;
}
.category-chip:nth-child(2n) .category-icon { animation-delay: .4s; }
.category-chip:nth-child(3n) .category-icon { animation-delay: .9s; }
.category-chip:hover .category-icon { animation: catWiggle .6s ease-in-out; }
@keyframes catFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes catWiggle { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-14deg); } 60% { transform: rotate(12deg); } }
@media (prefers-reduced-motion: reduce) {
    .category-icon { animation: none; }
}

/* ============================================================
   ABOUT / WHY US
   ============================================================ */
.about-section { padding: 90px 0 30px; }
.about-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px; align-items: center; }
.about-media { position: relative; }
.about-media img {
    width: 100%;
    border-radius: 30px;
    box-shadow: 0 30px 70px -30px rgba(12, 59, 46, .4);
}
.about-float-card {
    position: absolute;
    bottom: -24px;
    right: -18px;
    background: #fff;
    border-radius: 20px;
    padding: 18px 26px;
    box-shadow: 0 20px 50px -18px rgba(12, 59, 46, .4);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.float-number { font-family: 'Fraunces', serif; font-size: 1.9rem; font-weight: 900; color: var(--color-primary, #1b9e6f); }
.float-label { font-size: .8rem; color: #5d7a66; font-weight: 600; }
.about-content { }
.about-content .section-title { font-size: 2.3rem; margin-bottom: 14px; }
.section-lead { color: #4a6154; font-size: 1.05rem; margin: 0 0 24px; }
.benefit-list { list-style: none; padding: 0; margin: 0 0 28px; }
.benefit-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    font-weight: 600;
}
.benefit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e3f4e8, #cdecd8);
    font-size: 1.1rem;
}

/* ============================================================
   FEATURES
   ============================================================ */
.features-section { padding: 70px 0 20px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.feature-card {
    background: #fff;
    border-radius: var(--radius, 16px);
    padding: 30px 26px;
    box-shadow: 0 8px 30px -14px rgba(12, 59, 46, .18);
    transition: transform .25s ease, box-shadow .25s ease;
    border: 1px solid rgba(12, 59, 46, .06);
}
.feature-card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px -18px rgba(12, 59, 46, .3); }
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px; height: 58px;
    font-size: 1.6rem;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--color-primary, #1b9e6f), var(--color-primary-dark, #0c4a34));
    margin-bottom: 16px;
    box-shadow: 0 10px 24px -8px rgba(27, 158, 111, .5);
}
.feature-card h3 { font-size: 1.15rem; }
.feature-card p { margin: 0; color: #55685d; font-size: .93rem; }

/* ============================================================
   PRODUCT SECTIONS + CARDS
   ============================================================ */
.products-section { padding: 60px 0 10px; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
    gap: 16px;
}
.section-head.center { justify-content: center; text-align: center; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}
.product-card {
    background: var(--color-surface, #fff);
    border-radius: var(--radius, 16px);
    overflow: hidden;
    box-shadow: 0 8px 28px -16px rgba(12, 59, 46, .25);
    border: 1px solid rgba(12, 59, 46, .05);
    transition: transform .25s ease, box-shadow .25s ease;
    display: flex;
    flex-direction: column;
}
.product-card:hover { transform: translateY(-8px); box-shadow: 0 26px 55px -20px rgba(12, 59, 46, .4); }
.product-media { position: relative; display: block; overflow: hidden; }
.product-media img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform .5s ease;
}
.product-card:hover .product-media img { transform: scale(1.07); }
.product-media .badge { position: absolute; top: 12px; left: 12px; z-index: 3; }
.product-media .badge.badge-soldout { left: auto; right: 12px; }
.quick-add-hint {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: rgba(8, 40, 29, .7);
    color: #fff;
    text-align: center;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 9px;
    transform: translateY(100%);
    transition: transform .3s ease;
    backdrop-filter: blur(4px);
}
.product-card:hover .quick-add-hint { transform: translateY(0); }

.product-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.product-name { font-weight: 700; color: var(--color-secondary, #0c3b2e); font-size: 1rem; line-height: 1.3; }
.product-name:hover { color: var(--color-primary, #1b9e6f); }
.price-row { margin: 8px 0 14px; display: flex; align-items: baseline; gap: 8px; }
.price-old { text-decoration: line-through; color: #9aa8a0; font-size: .9rem; }
.price-new { font-weight: 800; color: var(--color-primary, #1b9e6f); font-size: 1.1rem; }
.price-lg .price-new { font-size: 2rem; }
.price-lg .price-old { font-size: 1.3rem; }

.badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    background: #e5e7eb;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .3px;
}
.badge-sale { background: linear-gradient(135deg, #f66a4e, #e23d3d); color: #fff; }
.badge-featured { background: linear-gradient(135deg, #2fbf8f, #1b9e6f); color: #fff; }
.badge-soldout { background: #37424a; color: #fff; }
.badge-big { padding: 7px 14px; font-size: .9rem; }
.badge-completed { background: #d9f4e3; color: #0b6b42; }
.badge-pending { background: #fdf3d1; color: #8a5b00; }
.badge-processing { background: #dceefb; color: #16537e; }
.badge-shipped { background: #e9defb; color: #5b21b6; }
.badge-cancelled { background: #fde5e5; color: #a02424; }

/* ============================================================
   STATS BAND
   ============================================================ */
.stats-band {
    margin: 70px 0;
    background: linear-gradient(135deg, var(--color-primary-dark, #0c4a34), var(--color-primary, #1b9e6f));
    padding: 46px 0;
    color: #fff;
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 30px; text-align: center; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: 'Fraunces', serif; font-size: 2.5rem; font-weight: 900; color: #ffd768; }
.stat-lab { font-size: .9rem; opacity: .85; font-weight: 600; }

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonials-section { padding: 40px 0 70px; }
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.testimonial-card {
    background: #fff;
    border-radius: var(--radius, 16px);
    padding: 28px;
    box-shadow: 0 8px 30px -16px rgba(12, 59, 46, .22);
    border: 1px solid rgba(12, 59, 46, .06);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform .25s;
}
.testimonial-card:hover { transform: translateY(-5px); }
.testimonial-text { margin: 0; font-size: .98rem; color: #3c5247; flex: 1; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.author-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary, #1b9e6f), var(--color-primary-dark, #0c4a34));
    color: #fff;
    font-weight: 800;
}
.author-role { display: block; font-size: .78rem; color: #7a8b81; }
.stars { display: inline-flex; gap: 2px; }

/* ============================================================
   CTA BAND
   ============================================================ */
.cta-band {
    background: linear-gradient(120deg, #0b3d2c, #11694a 55%, #1b9e6f);
    padding: 64px 0;
    margin: 20px 0 0;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.cta-band::before, .cta-band::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .14);
    width: 340px; height: 340px;
}
.cta-band::before { top: -120px; left: -80px; }
.cta-band::after { bottom: -160px; right: -60px; width: 420px; height: 420px; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; position: relative; z-index: 2; flex-wrap: wrap; }
.cta-text h2 { color: #fff; font-size: 2.2rem; }
.cta-text p { color: rgba(255, 255, 255, .85); font-size: 1.05rem; margin: 0; }

/* ============================================================
   NEWSLETTER
   ============================================================ */
.newsletter-section { padding: 80px 0; }
.newsletter-card {
    background: linear-gradient(120deg, #fdf6e3, #f8f0d4);
    border-radius: 30px;
    padding: 40px 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
    box-shadow: 0 20px 50px -24px rgba(138, 101, 20, .4);
    border: 1px solid #f0dfae;
}
.newsletter-content { display: flex; gap: 18px; align-items: flex-start; flex: 1; min-width: 260px; }
.newsletter-icon { font-size: 2.4rem; }
.newsletter-content h2 { margin: 0 0 4px; }
.newsletter-content p { margin: 0; color: #7a5a20; }
.newsletter-form { display: flex; gap: 10px; flex: 1; min-width: 280px; }
.newsletter-form input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #ead9a6;
    border-radius: var(--radius, 16px);
    font-family: inherit;
    font-size: .95rem;
    background: #fff;
    margin-top: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: linear-gradient(180deg, #0a3124, #071f17);
    color: #b8ccc2;
    padding: 70px 0 0;
    margin-top: 20px;
    font-size: .92rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 40px;
    padding-bottom: 40px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.3rem; }
.footer-brand img { height: 36px; }
.footer-about { margin: 16px 0; color: #8fa89b; line-height: 1.7; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    transition: background .2s, transform .2s;
}
.footer-social a:hover { background: var(--color-accent, #f6b01e); color: #0a3124; transform: translateY(-3px); }
.site-footer h4 { color: #fff; font-family: 'Plus Jakarta Sans', sans-serif; font-size: .85rem; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 16px; }
.footer-links, .footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-links li, .footer-contact li { padding: 6px 0; }
.footer-links a { color: #8fa89b; transition: color .2s, padding-left .2s; }
.footer-links a:hover { color: var(--color-accent, #f6b01e); padding-left: 4px; }
.footer-contact li { display: flex; gap: 10px; align-items: center; color: #8fa89b; }
.footer-contact a { color: #8fa89b; }
.footer-contact a:hover { color: var(--color-accent, #f6b01e); }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: .82rem;
    color: #6f8b7c;
}
.payment-icons { display: flex; gap: 8px; }
.payment-icons span {
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 6px;
    padding: 4px 9px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #b8ccc2;
}

/* ============================================================
   SHOP LAYOUT
   ============================================================ */
.shop-layout { display: grid; grid-template-columns: 250px 1fr; gap: 30px; align-items: start; }
.shop-filters {
    position: sticky;
    top: 96px;
    background: #fff;
    border-radius: var(--radius, 16px);
    padding: 22px;
    box-shadow: 0 8px 30px -16px rgba(12, 59, 46, .22);
}
.shop-filters h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: .82rem; letter-spacing: 2px; text-transform: uppercase; margin: 22px 0 10px; }
.search-form { display: flex; gap: 8px; }
.search-form input {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius, 16px);
    border: 2px solid #dbe6dd;
    font-family: inherit;
}
.category-list { list-style: none; padding: 0; margin: 0; }
.category-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    margin: 2px -12px;
    color: var(--color-text, #17352c);
    border-radius: 12px;
    font-weight: 600;
    font-size: .93rem;
}
.cat-bullet { font-size: 1.05rem; }
.category-list a .count { font-size: .75rem; background: #eef5ef; padding: 2px 8px; border-radius: 999px; margin-left: auto; }
.category-list a.active, .category-list a:hover { background: rgba(27, 158, 111, .1); color: var(--color-primary, #1b9e6f); }
.result-count { color: #6c8175; font-size: .9rem; margin: 0 0 16px; font-weight: 600; }
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c8175;
}
.empty-state > span { font-size: 3rem; display: block; margin-bottom: 12px; }
.empty-state h2 { font-size: 1.5rem; }

/* ============================================================
   PRODUCT DETAIL
   ============================================================ */
.breadcrumbs { font-size: .88rem; color: #7a8b81; margin-bottom: 20px; }
.breadcrumbs a { color: #7a8b81; }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs .current { color: var(--color-text); font-weight: 600; }
.product-detail { display: grid; grid-template-columns: 1.05fr 1fr; gap: 50px; align-items: start; }
.main-image-wrap { position: relative; border-radius: var(--radius, 16px); overflow: hidden; box-shadow: 0 24px 60px -24px rgba(12, 59, 46, .35); }
.main-image { width: 100%; border-radius: var(--radius, 16px); display: block; }
.thumb-row { display: flex; gap: 10px; margin-top: 12px; }
.thumb {
    width: 76px; height: 76px;
    object-fit: cover;
    border-radius: 14px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .2s, transform .2s;
}
.thumb.active { border-color: var(--color-primary, #1b9e6f); }
.thumb:hover { transform: translateY(-2px); }
.product-name-lg { font-size: 2.3rem; }
.product-description { color: #4a6154; margin: 18px 0; }
.stock-line { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; margin-bottom: 20px; }
.stock-dot { width: 10px; height: 10px; border-radius: 50%; }
.stock-line.in .stock-dot { background: #2fbf8f; box-shadow: 0 0 0 4px rgba(47, 191, 143, .2); }
.stock-line.in { color: #0b6b42; }
.stock-line.out .stock-dot { background: #e05252; box-shadow: 0 0 0 4px rgba(224, 82, 82, .2); }
.stock-line.out { color: #a02424; }
.buy-form { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 8px 0 22px; }
.qty-stepper { display: inline-flex; align-items: center; border: 2px solid #dbe6dd; border-radius: var(--radius, 16px); overflow: hidden; }
.qty-btn {
    width: 44px; height: 48px;
    border: none;
    background: #f2f7f3;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--color-secondary);
    font-weight: 700;
}
.qty-btn:hover { background: var(--color-primary, #1b9e6f); color: #fff; }
.qty-stepper input {
    width: 56px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    background: #fff;
    -moz-appearance: textfield;
    padding: 12px 0;
    margin-top: 0;
}
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.perks-list { list-style: none; padding: 0; margin: 0; color: #4a6154; font-size: .92rem; }
.perks-list li { padding: 5px 0; }

/* ============================================================
   FORMS / AUTH
   ============================================================ */
form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: .9rem; }
form input, form select, form textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    border: 2px solid #dbe6dd;
    border-radius: var(--radius, 16px);
    font-family: inherit;
    font-size: .95rem;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
form input:focus, form select:focus, form textarea:focus {
    outline: none;
    border-color: var(--color-primary, #1b9e6f);
    box-shadow: 0 0 0 4px rgba(27, 158, 111, .15);
}
.auth-box {
    max-width: 440px;
    margin: 20px auto;
    background: #fff;
    padding: 36px;
    border-radius: 24px;
    box-shadow: 0 24px 60px -28px rgba(12, 59, 46, .35);
    border: 1px solid rgba(12, 59, 46, .06);
}
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head h1 { font-size: 1.8rem; }
.auth-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.auth-alt { text-align: center; margin: 18px 0 0; }
.auth-hint { text-align: center; font-size: .78rem; margin-top: 14px; }
.inline-form { display: inline-block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.auth-subhead { margin: 22px 0 14px; font-size: 1.05rem; }.radio-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 2px solid #dbe6dd;
    border-radius: var(--radius, 16px);
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color .2s;
}
.radio-row input { width: auto; margin: 0; }
.radio-row:hover { border-color: var(--color-primary, #1b9e6f); }

/* ============================================================
   CART / CHECKOUT / ACCOUNT
   ============================================================ */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius, 16px);
    overflow: hidden;
    box-shadow: 0 8px 30px -18px rgba(12, 59, 46, .25);
}
.cart-table th {
    background: #f2f7f3;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: .75rem;
    color: #4a6154;
}
.cart-table th, .cart-table td { padding: 14px; text-align: left; border-bottom: 1px solid #eef4ef; }
.cart-product-cell { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.cart-product-cell img { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; }
.cart-summary {
    text-align: right;
    margin-top: 24px;
    padding: 24px;
    background: #fff;
    border-radius: var(--radius, 16px);
    box-shadow: 0 8px 30px -18px rgba(12, 59, 46, .25);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}
.cart-summary h2 { margin: 0; }

.checkout-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: start; }
.checkout-form {
    background: #fff;
    border-radius: var(--radius, 16px);
    padding: 30px;
    box-shadow: 0 8px 30px -18px rgba(12, 59, 46, .25);
}
.checkout-form h2 { font-size: 1.3rem; margin: 22px 0 10px; }
.checkout-form h2:first-child { margin-top: 0; }
.checkout-summary {
    background: var(--color-secondary, #0c3b2e);
    color: #d8e6de;
    padding: 28px;
    border-radius: var(--radius, 16px);
    position: sticky;
    top: 96px;
    box-shadow: 0 20px 50px -20px rgba(12, 59, 46, .5);
}
.checkout-summary h2 { color: #fff; font-size: 1.2rem; border-bottom: 1px solid rgba(255, 255, 255, .12); padding-bottom: 12px; }
.checkout-summary ul { list-style: none; padding: 0; margin: 16px 0; }
.checkout-summary ul li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: .92rem; }
.summary-line { display: flex; justify-content: space-between; padding: 7px 0; font-size: .92rem; opacity: .85; }
.summary-line.summary-discount { color: #0b6b42; font-weight: 700; opacity: 1; }
.summary-total {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, .16);
    margin-top: 12px;
    padding-top: 14px;
    color: #ffd768;
    font-size: 1.25rem;
    font-weight: 800;
}

.account-layout { display: grid; grid-template-columns: 300px 1fr; gap: 30px; align-items: start; }
.profile-card {
    background: #fff;
    border-radius: var(--radius, 16px);
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 30px -18px rgba(12, 59, 46, .25);
    position: sticky;
    top: 96px;
}
.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary, #1b9e6f), var(--color-primary-dark, #0c4a34));
    color: #fff;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
}
.profile-stat { margin-top: 18px; padding-top: 14px; border-top: 1px solid #eef4ef; }
.profile-stat span { display: block; font-size: .78rem; color: #7a8b81; text-transform: uppercase; letter-spacing: 1px; }
.profile-stat strong { color: var(--color-secondary); }

.account-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.account-nav a { padding: 10px 14px; border-radius: 12px; color: var(--color-text); font-weight: 600; font-size: .92rem; transition: background .2s; }
.account-nav a:hover { background: rgba(27, 158, 111, .1); color: var(--color-primary); }

.account-main { display: flex; flex-direction: column; gap: 22px; }
.account-card {
    background: #fff;
    border-radius: var(--radius, 16px);
    padding: 26px;
    box-shadow: 0 8px 30px -18px rgba(12, 59, 46, .25);
    scroll-margin-top: 110px;
}
.account-card h2 { margin: 0 0 14px; }

.admin-form-like label { display: block; margin-bottom: 14px; font-weight: 700; font-size: .84rem; color: #3d5548; }
.admin-form-like input, .admin-form-like select, .admin-form-like textarea {
    width: 100%; margin-top: 6px; padding: 11px 13px;
    border: 2px solid #dbe6dd; border-radius: 12px;
    font-family: inherit; font-size: .93rem; background: #fff;
}
.admin-form-like input:focus, .admin-form-like textarea:focus { outline: none; border-color: var(--color-primary, #1b9e6f); }

.order-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: .95rem; }
.order-total { font-weight: 800; font-size: 1.1rem; color: var(--color-secondary); border-top: 1px solid #eef4ef; margin-top: 8px; }

.coupon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.coupon-card {
    border: 2px dashed var(--color-primary, #1b9e6f);
    border-radius: 14px;
    padding: 16px;
    background: linear-gradient(135deg, #f4fbf7, #eaf7ef);
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}
.coupon-tag {
    background: linear-gradient(135deg, var(--color-primary, #1b9e6f), var(--color-primary-dark, #0c4a34));
    color: #fff;
    font-weight: 800;
    font-size: .8rem;
    padding: 4px 10px;
    border-radius: 999px;
}
.coupon-code { font-size: 1.15rem; letter-spacing: 1px; color: var(--color-secondary); font-family: ui-monospace, monospace; }

.muted { color: #6c8175; font-size: .9rem; }

/* ============================================================
   HEADER ACTIONS · SEARCH · DRAWER · BOTTOM NAV
   ============================================================ */
.header-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--color-secondary, #0c3b2e);
    transition: background .2s, color .2s, transform .2s;
    position: relative;
}
.icon-btn:hover { background: rgba(27, 158, 111, .1); color: var(--color-primary, #1b9e6f); transform: translateY(-2px); }
.icon-btn .cart-badge { position: absolute; top: 1px; right: -1px; margin: 0; min-width: 18px; height: 18px; font-size: .68rem; }

.header-search {
    max-height: 0;
    overflow: hidden;
    background: #fff;
    border-top: 1px solid rgba(12, 59, 46, .06);
    transition: max-height .35s ease;
}
.header-search.open { max-height: 120px; }
.search-form-big { display: flex; gap: 10px; padding: 14px 0; }
.search-form-big input { flex: 1; margin-top: 0; padding: 12px 16px; border: 2px solid #dbe6dd; border-radius: var(--radius, 16px); font-family: inherit; font-size: .95rem; }
.search-form-big input:focus { outline: none; border-color: var(--color-primary, #1b9e6f); box-shadow: 0 0 0 4px rgba(27, 158, 111, .15); }

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(8, 30, 22, .55);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.mobile-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 85;
    width: min(340px, 88vw);
    background: #fff;
    box-shadow: -20px 0 60px -20px rgba(12, 59, 46, .5);
    transform: translateX(105%);
    transition: transform .38s cubic-bezier(.22, 1, .36, 1);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}
.mobile-drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.drawer-title { font-family: 'Fraunces', serif; font-size: 1.3rem; font-weight: 700; color: var(--color-secondary, #0c3b2e); }
.drawer-search { display: flex; gap: 8px; margin-bottom: 18px; }
.drawer-search input { flex: 1; margin-top: 0; }
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 14px;
    color: var(--color-secondary, #0c3b2e);
    font-weight: 600;
    font-size: 1rem;
    transition: background .2s, transform .2s, color .2s;
}
.drawer-nav a:hover { background: rgba(27, 158, 111, .1); color: var(--color-primary, #1b9e6f); transform: translateX(3px); }
.drawer-nav a .cart-badge { margin-left: auto; }
.drawer-divider { height: 1px; background: #eef4ef; margin: 14px 0; }
.drawer-account a { color: #4a6154; }
.drawer-foot { margin-top: auto; padding-top: 18px; font-size: .85rem; color: #7a8b81; border-top: 1px solid #eef4ef; }

.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 70;
    display: none;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(12, 59, 46, .1);
    box-shadow: 0 -8px 30px -12px rgba(12, 59, 46, .25);
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 0 7px;
    color: #6c8175;
    font-size: .68rem;
    font-weight: 700;
    position: relative;
}
.bottom-nav a svg { transition: transform .2s; }
.bottom-nav a:hover svg { transform: translateY(-2px); }
.bottom-nav a.active { color: var(--color-primary, #1b9e6f); }
.bottom-nav a.active svg { fill: rgba(27, 158, 111, .14); }
.bottom-nav .cart-badge { position: absolute; top: 3px; left: 55%; margin: 0; min-width: 18px; height: 18px; font-size: .68rem; }

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 48px; height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--color-secondary, #0c3b2e);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: all .3s ease;
    z-index: 90;
    box-shadow: 0 12px 30px -10px rgba(12, 59, 46, .6);
}
.back-to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top:hover { background: var(--color-primary, #1b9e6f); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius, 16px); }
.table-scroll .cart-table, .table-scroll table { min-width: 620px; }

@media (max-width: 980px) {
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .about-float-card { right: 12px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .product-detail { grid-template-columns: 1fr; gap: 30px; }
    .account-layout { grid-template-columns: 1fr; }
    .profile-card { position: static; }
    .checkout-layout { grid-template-columns: 1fr; }
    .checkout-summary { position: static; }
    .hero { height: 70vh; min-height: 540px; }
}

@media (max-width: 800px) {
    .main-nav-desktop { display: none; }
    .nav-toggle { display: flex; }
    .header-actions .icon-btn[aria-label="Account"] { display: none; }

    body { padding-bottom: 66px; }
    .bottom-nav { display: flex; }

    .page-main { padding-bottom: 40px; }
    .toast-wrap { right: 14px; bottom: 84px; }
    .back-to-top { bottom: 84px; right: 14px; }
    .back-to-top { width: 42px; height: 42px; }

    .shop-layout { grid-template-columns: 1fr; }
    .shop-filters { position: static; }
    .section-head { flex-direction: column; align-items: flex-start; }
    .category-strip {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 8px;
        margin-top: -20px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .category-strip::-webkit-scrollbar { display: none; }
    .category-chip { flex: 0 0 auto; scroll-snap-align: start; }
    .newsletter-card { padding: 28px 22px; }
    .newsletter-form { flex-direction: column; }
    .form-grid { grid-template-columns: 1fr; }
    .stats-band { margin: 50px 0; }
    .hero-title { font-size: clamp(2rem, 8vw, 2.8rem); }
    .cta-inner { flex-direction: column; align-items: flex-start; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .footer-bottom { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
    .container { padding: 0 14px; }
    .brand-name { font-size: 1.15rem; }
    .brand-logo { height: 32px; }
    .header-inner { gap: 8px; }
    .hero { height: 60vh; min-height: 430px; }
    .hero-badge { font-size: .75rem; padding: 6px 12px; }
    .hero-actions .btn { padding: 11px 18px; font-size: .9rem; }
    .category-chip { padding: 10px 16px; font-size: .85rem; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
    .product-body { padding: 12px; }
    .product-name { font-size: .9rem; }
    .price-row { flex-direction: column; gap: 2px; margin: 6px 0 10px; }
    .price-new { font-size: 1rem; }
    .features-grid { grid-template-columns: 1fr; }
    .newsletter-card { padding: 22px 16px; }
    .newsletter-content { flex-direction: column; gap: 8px; }
    .btn-lg { padding: 13px 22px; font-size: 1rem; }
    .cart-summary { flex-direction: column; align-items: stretch; text-align: center; }
    .checkout-form { padding: 20px; }
    .auth-box { padding: 26px 20px; }
    .footer-grid { gap: 24px; }
    .payment-icons { display: none; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   CART REBUILD — DB-backed cart UI (modern + animated)
   ============================================================ */

/* ----- Keyframe library ----- */
@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-9px); }
}
@keyframes shine {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(22px); }
    to   { opacity: 1; transform: none; }
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
@keyframes badgePop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.55); }
    100% { transform: scale(1); }
}
@keyframes sweep {
    to { left: 135%; }
}

.cart-badge.pop, .cart-drawer-count.pop { animation: badgePop .45s ease; }

/* ----- Product card cascade entrance ----- */
.product-grid .product-card { animation: cardIn .55s cubic-bezier(.22, 1, .36, 1) backwards; }
.product-grid .product-card:nth-child(1)  { animation-delay: .03s; }
.product-grid .product-card:nth-child(2)  { animation-delay: .07s; }
.product-grid .product-card:nth-child(3)  { animation-delay: .11s; }
.product-grid .product-card:nth-child(4)  { animation-delay: .15s; }
.product-grid .product-card:nth-child(5)  { animation-delay: .19s; }
.product-grid .product-card:nth-child(6)  { animation-delay: .23s; }
.product-grid .product-card:nth-child(7)  { animation-delay: .27s; }
.product-grid .product-card:nth-child(8)  { animation-delay: .31s; }
.product-grid .product-card:nth-child(9)  { animation-delay: .35s; }
.product-grid .product-card:nth-child(10) { animation-delay: .39s; }
.product-grid .product-card:nth-child(11) { animation-delay: .43s; }
.product-grid .product-card:nth-child(12) { animation-delay: .47s; }

/* Add-to-cart button sheen sweep */
.add-cart-form .btn { position: relative; overflow: hidden; }
.add-cart-form .btn::after {
    content: '';
    position: absolute;
    top: 0; left: -80%;
    width: 50%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
}
.add-cart-form .btn:hover::after { animation: sweep .75s ease; }

/* Fly-to-cart dot */
.fly-dot {
    position: fixed;
    z-index: 400;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffd768, var(--color-accent, #f6b01e));
    box-shadow: 0 0 0 6px rgba(246, 176, 30, .22), 0 10px 22px rgba(0, 0, 0, .28);
    pointer-events: none;
}

/* ----- Mini-cart drawer ----- */
.cart-drawer-backdrop {
    position: fixed; inset: 0;
    z-index: 160;
    background: rgba(8, 30, 22, .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}
.cart-drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 165;
    width: min(400px, 92vw);
    background: #fff;
    border-top-left-radius: 24px;
    border-bottom-left-radius: 24px;
    box-shadow: -30px 0 80px -30px rgba(12, 59, 46, .5);
    transform: translateX(105%);
    transition: transform .45s cubic-bezier(.22, 1, .36, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cart-drawer.open { transform: none; }

.cart-drawer-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 22px;
    border-bottom: 1px solid #eef4ef;
    background: linear-gradient(135deg, #fbfdfb, #f2f8f4);
}
.cart-drawer-head .drawer-title { font-size: 1.3rem; margin: 0; }
.cart-drawer-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px; height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-primary, #1b9e6f), var(--color-primary-dark, #0c4a34));
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
}
.cart-drawer-close { margin-left: auto; }

.cart-free-ship { padding: 16px 22px 0; font-size: .82rem; font-weight: 700; color: #0b6b42; }
.cart-free-ship .fs-label { margin-bottom: 9px; line-height: 1.4; }
.cart-free-ship .fs-label strong { color: var(--color-primary, #1b9e6f); }
.cart-free-ship .fs-track {
    height: 9px;
    border-radius: 999px;
    background: #e7efe9;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(12, 59, 46, .1);
}
.cart-free-ship .fs-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-primary, #1b9e6f), var(--color-accent, #f6b01e));
    background-size: 200% 100%;
    animation: shine 2.6s linear infinite;
    transition: width .7s cubic-bezier(.22, 1, .36, 1);
    position: relative;
}

.cart-drawer-items {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
}
.mc-item {
    display: flex;
    gap: 12px;
    align-items: center;
    animation: slideIn .38s ease backwards;
    padding: 10px;
    border: 1px solid #eef4ef;
    border-radius: 16px;
    background: #fdfefd;
    transition: transform .2s ease, box-shadow .2s ease;
}
.mc-item:hover { transform: translateX(3px); box-shadow: 0 10px 24px -14px rgba(12, 59, 46, .3); }
.mc-item img {
    width: 62px; height: 62px;
    object-fit: cover;
    border-radius: 14px;
    flex-shrink: 0;
    background: #f2f7f3;
}
.mc-info { flex: 1; min-width: 0; }
.mc-name {
    display: block;
    font-weight: 700;
    color: var(--color-secondary, #0c3b2e);
    font-size: .9rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mc-name:hover { color: var(--color-primary, #1b9e6f); }
.mc-price { font-size: .8rem; color: var(--color-primary, #1b9e6f); font-weight: 800; margin: 3px 0 8px; }
.mc-stepper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #dbe6dd;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}
.mc-stepper button {
    width: 27px; height: 27px;
    border: none;
    background: #f2f7f3;
    cursor: pointer;
    font-weight: 800;
    font-size: 1rem;
    color: var(--color-secondary, #0c3b2e);
    line-height: 1;
    transition: background .2s, color .2s;
}
.mc-stepper button:hover { background: var(--color-primary, #1b9e6f); color: #fff; }
.mc-stepper .mc-qty { min-width: 32px; text-align: center; font-weight: 800; font-size: .84rem; }
.mc-remove {
    border: none;
    background: none;
    color: #b3c0b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 6px;
    flex-shrink: 0;
    transition: color .2s, transform .2s;
}
.mc-remove:hover { color: #e05252; transform: scale(1.25) rotate(90deg); }

.cart-drawer-empty {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    padding: 30px;
    color: #6c8175;
}
.cart-drawer-empty.show { display: flex; }
.cart-drawer-empty .cart-empty-icon { font-size: 2.6rem; animation: floaty 3s ease-in-out infinite; }
.cart-drawer-empty p { margin: 8px 0 16px; font-weight: 700; color: var(--color-secondary, #0c3b2e); font-size: 1.05rem; }

.cart-drawer-foot {
    padding: 18px 22px 24px;
    border-top: 1px solid #eef4ef;
    background: #fbfdfb;
}
.cart-drawer-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-weight: 600;
    color: #4a6154;
}
.cart-drawer-subtotal strong {
    font-size: 1.35rem;
    color: var(--color-secondary, #0c3b2e);
    font-family: 'Fraunces', serif;
}
.cart-drawer-foot .btn { margin-bottom: 9px; }
.cart-drawer-note { text-align: center; font-size: .74rem; color: #8aa093; margin: 8px 0 0; }

/* ----- Cart page ----- */
.cart-hero { text-align: center; margin-bottom: 26px; }
.cart-hero .page-title { margin-bottom: 4px; }

.cart-layout {
    display: grid;
    grid-template-columns: 1.9fr 1fr;
    gap: 28px;
    align-items: start;
}

.free-ship-bar {
    background: #fff;
    border: 1px solid #e4efe8;
    border-radius: var(--radius, 16px);
    padding: 16px 20px;
    margin-bottom: 18px;
    box-shadow: 0 8px 26px -18px rgba(12, 59, 46, .25);
}
.free-ship-label {
    display: flex;
    justify-content: center;
    font-size: .85rem;
    font-weight: 600;
    color: #3c5247;
    margin-bottom: 10px;
    text-align: center;
}
.free-ship-label strong { color: var(--color-primary, #1b9e6f); }
.free-ship-track {
    height: 10px;
    border-radius: 999px;
    background: #e7efe9;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(12, 59, 46, .08);
}
.free-ship-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-primary, #1b9e6f), var(--color-accent, #f6b01e));
    background-size: 200% 100%;
    animation: shine 2.6s linear infinite;
    transition: width .8s cubic-bezier(.22, 1, .36, 1);
}

.cart-items-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.cart-item-card {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 16px;
    align-items: center;
    background: #fff;
    border: 1px solid rgba(12, 59, 46, .06);
    border-radius: var(--radius, 16px);
    padding: 14px;
    box-shadow: 0 8px 28px -18px rgba(12, 59, 46, .25);
    transition: transform .25s ease, box-shadow .25s ease, opacity .35s ease;
    animation: cardIn .5s cubic-bezier(.22, 1, .36, 1) backwards;
}
.cart-items-list .cart-item-card:nth-child(1)  { animation-delay: .04s; }
.cart-items-list .cart-item-card:nth-child(2)  { animation-delay: .08s; }
.cart-items-list .cart-item-card:nth-child(3)  { animation-delay: .12s; }
.cart-items-list .cart-item-card:nth-child(4)  { animation-delay: .16s; }
.cart-items-list .cart-item-card:nth-child(5)  { animation-delay: .20s; }
.cart-items-list .cart-item-card:nth-child(6)  { animation-delay: .24s; }
.cart-items-list .cart-item-card:nth-child(7)  { animation-delay: .28s; }
.cart-items-list .cart-item-card:nth-child(8)  { animation-delay: .32s; }
.cart-items-list .cart-item-card:nth-child(9)  { animation-delay: .36s; }
.cart-items-list .cart-item-card:nth-child(10) { animation-delay: .40s; }
.cart-item-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -20px rgba(12, 59, 46, .35); }
.cart-item-media img {
    width: 96px; height: 96px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
    background: #f2f7f3;
    transition: transform .4s ease;
}
.cart-item-media:hover img { transform: scale(1.07); }
.cart-item-name { font-weight: 800; color: var(--color-secondary, #0c3b2e); font-size: 1.02rem; line-height: 1.3; }
.cart-item-name:hover { color: var(--color-primary, #1b9e6f); }
.cart-item-unit { display: block; font-size: .82rem; color: #7a8b81; margin: 2px 0 6px; }
.cart-item-low {
    display: inline-block;
    font-size: .72rem;
    font-weight: 800;
    color: #a02424;
    background: #fde5e5;
    border-radius: 999px;
    padding: 2px 9px;
    margin-bottom: 8px;
}
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cart-item-line {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--color-primary, #1b9e6f);
    font-family: 'Fraunces', serif;
    transition: all .3s ease;
}
.cart-remove {
    border: none;
    background: none;
    cursor: pointer;
    color: #b3c0b8;
    font-size: 1.05rem;
    padding: 4px;
    transition: color .2s, transform .2s;
}
.cart-remove:hover { color: #e05252; transform: rotate(90deg) scale(1.2); }
.cart-qty-form { margin-top: 2px; }
.cart-item-info .mc-stepper { margin-top: 4px; }

.stepper-sm .qty-btn { width: 34px; height: 34px; font-size: 1.05rem; }
.stepper-sm input { width: 44px; padding: 6px 0; font-size: .9rem; }

.cart-back-link { margin-top: 4px; }

.cart-summary-card {
    background: linear-gradient(160deg, #ffffff, #f2faf5);
    border: 1px solid #e0ece5;
    border-radius: 22px;
    padding: 26px;
    position: sticky;
    top: 96px;
    box-shadow: 0 24px 60px -28px rgba(12, 59, 46, .4);
}
.cart-summary-card h2 {
    font-size: 1.25rem;
    padding-bottom: 12px;
    border-bottom: 1px solid #e4efe8;
    margin-bottom: 6px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    color: #4a6154;
    font-size: .95rem;
}
.summary-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1.5px dashed #d6e4da;
    margin-top: 10px;
    padding-top: 14px;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--color-secondary, #0c3b2e);
    font-family: 'Fraunces', serif;
}
.cart-checkout-btn { margin-top: 18px; animation: floaty 3.4s ease-in-out infinite; }
.btn-ghost-dark { background: #e9f2ec; color: var(--color-secondary, #0c3b2e); }
.btn-ghost-dark:hover { background: #dcebe2; transform: translateY(-2px); }
.cart-trust {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    font-size: .72rem;
    color: #7a8b81;
    font-weight: 700;
}

.cart-empty-state { padding: 70px 20px; }
.cart-empty-art { font-size: 3.4rem; animation: floaty 3.2s ease-in-out infinite; }

@media (max-width: 900px) {
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary-card { position: static; }
}

@media (max-width: 600px) {
    .cart-item-card {
        grid-template-columns: 72px 1fr;
        gap: 12px;
        padding: 12px;
    }
    .cart-item-media img { width: 72px; height: 72px; }
    .cart-item-right {
        grid-column: 2;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .cart-drawer { width: 100vw; border-radius: 0; }
    .cart-checkout-btn { animation: none; }
}
