/* ═══════════════════════════════════════════════════════════════
   SUPER ALMOUROL — Mercearia Tradicional · Style Azulejo
   Fonts: Cormorant Garamond (display) + Source Sans 3 (body)
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
    /* ── Palette tapis / carpets ──────────────────────────── */
    --charcoal:       #252830;   /* tapis sombre · charbon profond */
    --charcoal-mid:   #4A4E57;
    --charcoal-light: #E8E9EC;
    --azul:           #1B5E8A;   /* azulejo (pattern seulement) */
    --azul-dark:      #0F3D5E;
    --azul-light:     #D4E8F5;
    --azul-pale:      #EBF4FA;
    --cream:          #F8F3EB;   /* tapis ivoire · fond chaud */
    --warm:           #EEE5D4;
    --terracotta:     #C04520;   /* tapis rouille · accent principal */
    --terracotta-dk:  #9A3318;
    --gold:           #C8920E;
    --gold-light:     #F2E4B0;

    /* ── System tokens (back-compat with cart/checkout) ───── */
    --primary:           var(--charcoal);
    --primary-dark:      #12141A;
    --primary-mid:       var(--charcoal-mid);
    --primary-light:     var(--azul-light);
    --primary-xlight:    var(--azul-pale);
    --accent-gold:       var(--gold);
    --accent-gold-dark:  #A8780F;
    --accent-gold-light: var(--gold-light);
    --accent-red:        var(--terracotta);
    --accent-red-light:  #FAE8E0;

    --bg:          var(--cream);
    --bg-card:     #FFFFFF;
    --bg-warm:     var(--warm);
    --bg-subtle:   #F8F4EE;

    --text:        #1E1F23;
    --text-muted:  #76716A;
    --text-light:  #ACA9A2;

    --border:      #E0D5C4;
    --border-light:#EDE6D8;

    --shadow-xs: 0 1px 2px rgba(27,94,138,.04);
    --shadow-sm: 0 1px 4px rgba(27,94,138,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow:    0 2px 8px rgba(27,94,138,.08), 0 1px 3px rgba(0,0,0,.04);
    --shadow-md: 0 4px 16px rgba(27,94,138,.10), 0 2px 6px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 32px rgba(27,94,138,.12), 0 4px 12px rgba(0,0,0,.07);

    --radius-xs:   2px;
    --radius-sm:   3px;
    --radius:      4px;
    --radius-lg:   6px;
    --radius-pill: 50px;

    --t-fast: 150ms ease;
    --t:      220ms ease;
    --t-slow: 320ms cubic-bezier(.4,0,.2,1);

    /* back-compat aliases */
    --ink: var(--text);
    --ink-soft: var(--text-muted);
    --muted: var(--text-light);
    --line: var(--border);
    --line-soft: var(--border-light);
    --surface: var(--bg-card);
    --bg-alt: var(--bg-warm);
    --accent: var(--primary);
    --accent-dark: var(--primary-dark);
    --accent-soft: var(--primary-xlight);
    --gold-soft: var(--accent-gold-light);
    --danger: var(--accent-red);
    --danger-soft: var(--accent-red-light);
    --success: var(--primary-mid);
    --success-soft: var(--primary-xlight);
    --warn: var(--accent-gold-dark);
    --warn-soft: var(--accent-gold-light);

    --font-brand: 'Cormorant Garamond', Georgia, serif;
    --font-body:  'Source Sans 3', system-ui, sans-serif;
    --font-serif: var(--font-brand);
    --font-sans:  var(--font-body);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { overflow-x: hidden; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main { flex: 1; }

img { display: block; max-width: 100%; }
button { font-family: var(--font-body); }
a { color: var(--terracotta); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--charcoal); }

h1, h2, h3 {
    font-family: var(--font-brand);
    color: var(--text);
    line-height: 1.15;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 400; margin-bottom: .5rem; letter-spacing: -.01em; }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); font-weight: 400; margin-bottom: .75rem; letter-spacing: -.005em; }
h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: .25rem; }

.muted { color: var(--text-muted); }
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 2.5rem; }

/* ── AZULEJO PATTERN ─────────────────────────────────────────── */
.azulejo-pattern {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Crect width='80' height='80' fill='%23C8C0B6'/%3E%3Crect x='2' y='2' width='76' height='76' fill='%23F8F3EB'/%3E%3Crect x='5' y='5' width='70' height='70' fill='none' stroke='%23252830' stroke-width='1.2'/%3E%3Cpath d='M2,16 A14,14 0 0,1 16,2' fill='none' stroke='%23252830' stroke-width='1.8'/%3E%3Cpath d='M64,2 A14,14 0 0,0 78,16' fill='none' stroke='%23252830' stroke-width='1.8'/%3E%3Cpath d='M2,64 A14,14 0 0,0 16,78' fill='none' stroke='%23252830' stroke-width='1.8'/%3E%3Cpath d='M64,78 A14,14 0 0,1 78,64' fill='none' stroke='%23252830' stroke-width='1.8'/%3E%3Cpath d='M40,20 L60,40 L40,60 L20,40 Z' fill='none' stroke='%23252830' stroke-width='1.2'/%3E%3Ccircle cx='40' cy='40' r='6' fill='none' stroke='%23252830' stroke-width='1'/%3E%3Ccircle cx='40' cy='40' r='2.5' fill='%23252830'/%3E%3Ccircle cx='13' cy='13' r='2.5' fill='%23252830'/%3E%3Ccircle cx='67' cy='13' r='2.5' fill='%23252830'/%3E%3Ccircle cx='13' cy='67' r='2.5' fill='%23252830'/%3E%3Ccircle cx='67' cy='67' r='2.5' fill='%23252830'/%3E%3C/svg%3E");
    background-size: 80px 80px;
}

.azulejo-border {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='6' viewBox='0 0 40 6'%3E%3Cpath d='M0 3 Q5 0 10 3 Q15 6 20 3 Q25 0 30 3 Q35 6 40 3' fill='none' stroke='%23252830' stroke-width='1.5' opacity='.3'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    height: 6px;
    background-color: var(--cream);
}

/* ── HEADER ──────────────────────────────────────────────────── */
.site-header {
    background: var(--cream);
    color: var(--text);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(27,94,138,.06);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    height: 64px;
    padding-top: 0;
    padding-bottom: 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.brand-mark img, .brand-mark svg { width: 48px; height: 48px; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; gap: 2px; }
.brand-name {
    font-family: var(--font-brand);
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--charcoal);
    letter-spacing: .04em;
    line-height: 1.1;
}
.brand-tag {
    font-family: var(--font-body);
    font-size: .6rem;
    font-weight: 500;
    color: var(--charcoal-mid);
    letter-spacing: .22em;
    text-transform: uppercase;
    line-height: 1;
}
.header-nav { display: flex; align-items: center; gap: 1rem; }
.nav-link {
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 600;
    padding: .4rem .8rem;
    border-radius: var(--radius);
    transition: all var(--t);
}
.nav-link:hover { color: var(--terracotta); text-decoration: none; }

.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    height: 42px;
    padding: 0 1rem 0 .85rem;
    background: var(--terracotta);
    color: #fff;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: .85rem;
    box-shadow: 0 3px 10px rgba(196,87,42,.25);
    transition: all var(--t);
}
.cart-link:hover { background: var(--terracotta-dk); color: #fff; text-decoration: none; transform: translateY(-1px); }
.cart-link svg { width: 18px; height: 18px; }
.cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px; height: 20px;
    padding: 0 5px;
    background: var(--charcoal);
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    border-radius: var(--radius-pill);
    border: 2px solid var(--cream);
}

/* ── FLASHES ─────────────────────────────────────────────────── */
.flash-zone { margin-top: 1rem; display: grid; gap: .5rem; }
.flash {
    padding: .8rem 1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: .95rem;
    font-weight: 500;
}
.flash-success { background: var(--charcoal-light); color: var(--charcoal); border-color: #C8CACC; }
.flash-error { background: var(--accent-red-light); color: var(--terracotta-dk); border-color: #F5B5A0; }
.flash-info { background: var(--accent-gold-light); color: var(--accent-gold-dark); border-color: #F0D98C; }

/* ── HERO ────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; width: 100%; }

.hero-tiles {
    width: 100%;
    background-color: #C8C0B6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Crect width='100' height='100' fill='%23C8C0B6'/%3E%3Crect x='2' y='2' width='96' height='96' fill='%23F8F3EB'/%3E%3Crect x='6' y='6' width='88' height='88' fill='none' stroke='%23252830' stroke-width='1.5'/%3E%3Cpath d='M2,20 A18,18 0 0,1 20,2' fill='none' stroke='%23252830' stroke-width='2'/%3E%3Cpath d='M80,2 A18,18 0 0,0 98,20' fill='none' stroke='%23252830' stroke-width='2'/%3E%3Cpath d='M2,80 A18,18 0 0,0 20,98' fill='none' stroke='%23252830' stroke-width='2'/%3E%3Cpath d='M80,98 A18,18 0 0,1 98,80' fill='none' stroke='%23252830' stroke-width='2'/%3E%3Cpath d='M50,24 L76,50 L50,76 L24,50 Z' fill='none' stroke='%23252830' stroke-width='1.5'/%3E%3Ccircle cx='50' cy='50' r='7' fill='none' stroke='%23252830' stroke-width='1.2'/%3E%3Ccircle cx='50' cy='50' r='3' fill='%23252830'/%3E%3Ccircle cx='16' cy='16' r='3' fill='%23252830'/%3E%3Ccircle cx='84' cy='16' r='3' fill='%23252830'/%3E%3Ccircle cx='16' cy='84' r='3' fill='%23252830'/%3E%3Ccircle cx='84' cy='84' r='3' fill='%23252830'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    padding: 4rem 2.5rem;
    text-align: center;
}
.hero-tile-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    background: rgba(255,255,255,.92);
    padding: 1.6rem 2.8rem;
    border-radius: var(--radius);
    border: 1px solid rgba(37,40,48,.15);
    box-shadow: 0 4px 24px rgba(37,40,48,.10);
}
.hero-tile-card img { display: block; }
.hero-badge {
    display: inline-block;
    background: transparent;
    color: var(--charcoal-mid);
    font-size: .6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .28em;
    padding: .2rem 0;
    border-bottom: 1px solid currentColor;
}
.hero-content-wrap {
    width: 100%;
    background: var(--cream);
    padding: 3.5rem 2.5rem 4rem;
    text-align: center;
    border-top: 1px solid var(--border);
}
.hero-content { max-width: 560px; margin: 0 auto; }
.hero-content h1 {
    font-family: var(--font-brand);
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 300;
    color: var(--charcoal);
    margin-bottom: .6rem;
    line-height: 1.05;
    letter-spacing: -.01em;
}
.hero-content h1 em { font-style: italic; color: var(--terracotta); font-weight: 400; }
.hero-content p { color: var(--text-muted); font-size: 1rem; line-height: 1.6; }

/* legacy hero classes (no-op, keep for safety) */
.hero-inner, .hero-eyebrow, .hero-tag, .hero-sub, .hero-features { all: unset; }

/* ── CATEGORY PILLS ──────────────────────────────────────────── */
.catalogue { padding: 3rem 0 5rem; }
.cat-pills {
    display: flex;
    gap: .6rem;
    margin-bottom: 2.5rem;
    padding-bottom: .25rem;
    flex-wrap: wrap;
    justify-content: center;
}
.pill {
    display: inline-flex;
    align-items: center;
    padding: .65rem 1.6rem;
    border-radius: var(--radius);
    background: #fff;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 600;
    transition: all var(--t);
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}
.pill::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%; right: 20%;
    height: 2px;
    background: var(--terracotta);
    transform: scaleX(0);
    transition: transform var(--t);
}
.pill:hover { border-color: var(--charcoal); color: var(--charcoal); text-decoration: none; }
.pill:hover::after { transform: scaleX(1); }
.pill.is-active {
    background: var(--charcoal);
    color: #fff;
    border-color: var(--charcoal);
    box-shadow: 0 2px 8px rgba(37,40,48,.20);
}
.pill.is-active::after { display: none; }

/* ── CATEGORY BLOCKS ─────────────────────────────────────────── */
.cat-block { margin-bottom: 3rem; scroll-margin-top: 80px; }
.cat-title {
    font-family: var(--font-brand);
    font-weight: 400;
    font-size: clamp(1.3rem, 2.2vw, 1.7rem);
    color: var(--charcoal);
    margin-bottom: 1.25rem;
    letter-spacing: .03em;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.cat-title::before {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border));
}
.cat-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to left, transparent, var(--border));
}

/* ── PRODUCT GRID ────────────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 320px));
    gap: 1.5rem;
    justify-content: center;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: visible;
    display: flex;
    flex-direction: column;
    transition: transform var(--t), box-shadow var(--t);
    position: relative;
}
/* Azulejo double-border frame */
.product-card::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid var(--charcoal-light);
    border-radius: 2px;
    pointer-events: none;
    z-index: 1;
    transition: border-color var(--t);
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 12px 36px rgba(37,40,48,.10); }
.product-card:hover::before { border-color: var(--terracotta); }
.product-card.is-out { opacity: .55; }

.product-media {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--warm);
    border-radius: var(--radius) var(--radius) 0 0;
}
.product-media img {
    width: 100%; height: 100%;
    object-fit: contain;
    padding: .5rem;
    transition: transform var(--t-slow);
    display: block;
}
.product-card:hover .product-media img { transform: scale(1.04); }
.product-media .placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-media .placeholder svg { width: 40%; height: 40%; opacity: .35; }

.badge {
    position: absolute;
    top: .6rem;
    font-size: .65rem;
    font-weight: 700;
    padding: .22rem .55rem;
    border-radius: 2px;
    letter-spacing: .04em;
    text-transform: uppercase;
    z-index: 2;
}
.badge-low {
    left: .6rem;
    background: var(--gold-light);
    color: #8B6914;
    border: 1px solid var(--gold);
}
.badge-out {
    right: .6rem;
    background: var(--terracotta);
    color: #fff;
}

.product-body {
    padding: .9rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    flex: 1;
}
.product-name {
    font-family: var(--font-brand);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--charcoal);
    line-height: 1.3;
    margin: 0;
    letter-spacing: .01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-desc {
    font-size: .78rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}
.product-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: .7rem;
    border-top: 1px solid var(--border);
    gap: .5rem;
}
.price {
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text);
    letter-spacing: -.3px;
    line-height: 1;
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1.25rem;
    border-radius: var(--radius);
    border: 1.5px solid transparent;
    font: inherit;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: .88rem;
    cursor: pointer;
    transition: all var(--t);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--charcoal);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,40,48,.20);
}
.btn-primary:hover { background: #12141A; color: #fff; box-shadow: 0 6px 16px rgba(37,40,48,.28); }

.btn-ghost { background: transparent; color: var(--charcoal); border-color: var(--border); }
.btn-ghost:hover { background: var(--charcoal-light); color: var(--charcoal); border-color: var(--charcoal-light); }

.btn-gold {
    background: var(--gold);
    color: var(--charcoal);
    box-shadow: 0 2px 8px rgba(212,160,23,.32);
}
.btn-gold:hover { background: var(--accent-gold-dark); color: #fff; }

.btn-disabled { background: var(--bg-warm); color: var(--text-light); cursor: not-allowed; border-color: var(--border); }
.btn-disabled:hover { transform: none; box-shadow: none; }

.btn-block { display: flex; width: 100%; margin-top: .5rem; }
.btn-lg { padding: .9rem 1.5rem; font-size: .95rem; }
.btn-sm { padding: .4rem .8rem; font-size: .8rem; }

/* Add-to-cart button inside product card */
.add-form { margin: 0; }
.product-card .add-form .btn {
    width: 40px; height: 40px; padding: 0;
    border-radius: var(--radius);
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1;
    background: transparent;
    color: var(--terracotta);
    border: 2px solid var(--terracotta);
    box-shadow: none;
}
.product-card .add-form .btn:hover {
    background: var(--terracotta);
    color: #fff;
    transform: rotate(90deg) scale(1.05);
    box-shadow: 0 4px 12px rgba(196,87,42,.3);
}

/* ── PAGE HEAD ────────────────────────────────────────────────── */
.page-head { padding: 2rem 0 1rem; }
.page-head h1 { margin-bottom: .25rem; color: var(--charcoal); }

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.empty-state { color: var(--text-muted); padding: 3rem 0; text-align: center; }

/* ── CART ─────────────────────────────────────────────────────── */
.empty-card {
    background: #fff;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 1.5rem;
    text-align: center;
    max-width: 480px;
    margin: 1.5rem auto 4rem;
}
.empty-card svg { margin-bottom: 1rem; opacity: .6; }
.empty-card .btn { margin-top: 1rem; }

.cart-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-bottom: 3rem;
}
@media (min-width: 860px) { .cart-layout { grid-template-columns: 1fr 360px; align-items: start; } }

.cart-items { display: grid; gap: .75rem; }
.cart-row {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    grid-template-areas:
        "media main remove"
        "media qty total";
    gap: .5rem 1rem;
    align-items: center;
    padding: .85rem;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--t);
}
.cart-row:hover { border-color: var(--charcoal-light); }
@media (min-width: 620px) {
    .cart-row {
        grid-template-columns: 80px 1fr auto auto auto;
        grid-template-areas: "media main qty total remove";
    }
}
.cart-row-media { grid-area: media; width: 72px; height: 72px; border-radius: var(--radius); overflow: hidden; background: var(--warm); }
.cart-row-media img { width: 100%; height: 100%; object-fit: contain; padding: 4px; display: block; }
.cart-row-media svg { width: 100%; height: 100%; display: block; padding: 16px; opacity: .4; }
.cart-row-main { grid-area: main; min-width: 0; }
.cart-row-name { font-size: .95rem; font-weight: 700; margin: 0 0 .15rem; color: var(--charcoal); }
.cart-row-price { font-size: .82rem; color: var(--text-muted); }
.cart-row-total { grid-area: total; font-family: var(--font-brand); font-weight: 600; color: var(--charcoal); text-align: right; font-size: 1.05rem; }

.qty-group {
    grid-area: qty;
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    background: var(--bg);
    border-radius: var(--radius-pill);
    padding: .2rem;
    border: 1px solid var(--border);
}
.qty-mini { display: inline-flex; align-items: center; margin: 0; }
.qty-btn {
    background: transparent;
    border: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--charcoal);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t);
}
.qty-btn:hover { background: var(--charcoal-light); }
.qty-input {
    width: 44px;
    text-align: center;
    border: none;
    background: transparent;
    font: inherit;
    font-weight: 700;
    color: var(--text);
    -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.icon-btn {
    grid-area: remove;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--terracotta);
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t);
}
.icon-btn:hover { background: var(--accent-red-light); border-color: var(--terracotta); }

/* ── CART SUMMARY ─────────────────────────────────────────────── */
.summary-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: sticky;
    top: 84px;
}
.summary-card h2 {
    font-family: var(--font-brand);
    font-size: 1.15rem;
    color: var(--charcoal);
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1.5px dashed var(--border);
}
.summary-row { display: flex; justify-content: space-between; padding: .45rem 0; font-size: .92rem; }
.summary-row.total {
    border-top: 1.5px solid var(--border);
    margin-top: .5rem;
    padding-top: .8rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--charcoal);
    font-family: var(--font-brand);
}

/* ── CHECKOUT ─────────────────────────────────────────────────── */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-bottom: 3rem;
    align-items: start;
}
@media (min-width: 900px) {
    .checkout-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 2rem; }
}
.checkout-main { min-width: 0; display: grid; gap: 1.25rem; }

fieldset.panel {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.5rem 1.25rem;
    margin: 0;
}
fieldset.panel > legend {
    font-family: var(--font-brand);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--charcoal);
    padding: 0 .5rem;
    margin-left: -.5rem;
}
fieldset.panel > legend small {
    font-family: var(--font-body);
    font-size: .78rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: .25rem;
}

.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }
.field > span {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: baseline;
    gap: .3rem;
}
.field > span em { color: var(--terracotta); font-style: normal; }
.field > span small { font-weight: 400; font-size: .72rem; color: var(--text-muted); }
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="number"],
.field input[type="password"],
.field textarea,
.field select,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: .72rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    font: inherit;
    font-family: var(--font-body);
    font-size: .92rem;
    color: var(--text);
    transition: all var(--t);
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.field input:focus,
.field textarea:focus,
.field select:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--charcoal);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,40,48,.08);
}
.field .err { color: var(--terracotta); font-size: .78rem; margin-top: .1rem; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: .4rem; }
.form-group label .req { color: var(--terracotta); }

.field-row { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 520px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field-row .field { margin-bottom: 0; }

/* Auth pages — login / register */
.auth-page {
    display: flex;
    justify-content: center;
    padding: 2.5rem 1rem 4rem;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 1.5);
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
    padding: 2.2rem 2rem;
    width: 100%;
    max-width: 420px;
}
.auth-card h1 {
    font-size: 1.45rem;
    margin: 0 0 1.6rem;
    text-align: center;
}
.auth-card .form-actions {
    margin-top: 1.5rem;
}
.auth-card .form-actions .btn {
    width: 100%;
    justify-content: center;
}
.auth-card .auth-switch {
    text-align: center;
    margin-top: 1.2rem;
    font-size: .85rem;
    color: var(--text-muted);
}

/* Account page */
.account-page {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1rem 4rem;
}
.account-page h1 {
    font-size: 1.5rem;
    margin: 0 0 1.5rem;
}
.account-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 680px) {
    .account-layout { grid-template-columns: 1fr; }
}
.account-profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 1.5);
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    padding: 1.5rem;
}
.account-profile-card .profile-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 .25rem;
}
.account-profile-card .profile-email {
    font-size: .85rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
    word-break: break-all;
}
.account-profile-card .profile-row {
    font-size: .875rem;
    margin: .35rem 0;
    color: var(--text);
}
.account-profile-card .profile-row span {
    color: var(--text-muted);
    font-size: .78rem;
    display: block;
}
.account-profile-card .btn {
    margin-top: 1.2rem;
    width: 100%;
    justify-content: center;
}
.account-orders-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 1.5);
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    padding: 1.5rem;
}
.account-orders-card h2 {
    font-size: 1rem;
    margin: 0 0 1rem;
}

/* Account edit form */
.account-edit-page {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem 4rem;
}
.account-edit-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 1.5);
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
    padding: 2.2rem 2rem;
    width: 100%;
    max-width: 520px;
}
.account-edit-card h1 {
    font-size: 1.3rem;
    margin: 0 0 1.5rem;
}
.account-edit-card .form-actions {
    margin-top: 1.5rem;
}
.account-edit-card .form-actions .btn {
    width: 100%;
    justify-content: center;
}
.account-edit-card fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1rem .5rem;
    margin-top: 1.5rem;
}
.account-edit-card fieldset legend {
    font-size: .82rem;
    font-weight: 700;
    padding: 0 .4rem;
    color: var(--text-muted);
}

.radio-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem 1.2rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    transition: all var(--t);
    margin-bottom: .65rem;
}
.radio-card:last-of-type { margin-bottom: 0; }
.radio-card:hover { border-color: var(--charcoal-light); background: var(--charcoal-light); }
.radio-card input[type="radio"] { flex-shrink: 0; width: 20px; height: 20px; accent-color: var(--charcoal); }
.radio-card > div { display: flex; flex-direction: column; gap: .1rem; }
.radio-card strong { font-family: var(--font-body); font-weight: 700; color: var(--text); font-size: .92rem; }
.radio-card .muted { font-size: .82rem; color: var(--text-muted); line-height: 1.4; }
.radio-card:has(input:checked) {
    border-color: var(--charcoal);
    background: var(--charcoal-light);
    box-shadow: 0 0 0 3px rgba(37,40,48,.06);
}
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card:has(input:checked) {
    border-color: var(--charcoal);
    background: var(--charcoal-light);
    box-shadow: 0 0 0 3px rgba(37,40,48,.06);
}
.radio-card-title { font-weight: 700; color: var(--text); }
.radio-card-hint { font-size: .82rem; color: var(--text-muted); }

.address-block { margin-top: 1rem; }
.address-block[hidden] { display: none; }

.payment-note {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .7rem 1rem;
    background: var(--gold-light);
    border: 1px solid #EED99C;
    border-radius: var(--radius);
    color: var(--charcoal);
    font-size: .88rem;
    font-weight: 500;
}
.payment-note svg { flex-shrink: 0; color: var(--accent-gold-dark); }

.checkout-summary {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: sticky;
    top: 84px;
    box-shadow: var(--shadow-sm);
}
.checkout-summary h2 {
    font-family: var(--font-brand);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 1.1rem;
    padding-bottom: .8rem;
    border-bottom: 1.5px dashed var(--border);
}
.sum-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .55rem; }
.sum-list li { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; font-size: .9rem; align-items: baseline; line-height: 1.4; }
.sum-qty { font-family: var(--font-body); font-weight: 700; color: var(--charcoal-mid); font-size: .85rem; }
.sum-name { color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-amt { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; white-space: nowrap; }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; padding: .45rem 0; font-size: .92rem; color: var(--text); }
.sum-row[hidden] { display: none; }
.sum-row.sum-total {
    border-top: 1.5px solid var(--border);
    margin-top: .35rem;
    padding-top: .9rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--charcoal);
    font-family: var(--font-brand);
}
.sum-row.sum-total > span:last-child { letter-spacing: -0.02em; }
.checkout-summary .btn { margin-top: .9rem; }
.checkout-summary .btn + .btn { margin-top: .5rem; }

/* ── ORDER SUCCESS ────────────────────────────────────────────── */
.success-card {
    background: #fff;
    border: 1.5px solid var(--charcoal-light);
    border-radius: var(--radius-lg);
    padding: clamp(2rem, 5vw, 3.5rem);
    text-align: center;
    max-width: 640px;
    margin: 2rem auto 4rem;
    box-shadow: var(--shadow-lg);
}
.success-check {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--warm);
    color: var(--terracotta);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 2.5rem;
}
.success-ref {
    display: inline-block;
    padding: .5rem 1.1rem;
    background: var(--gold-light);
    color: var(--charcoal);
    border: 1px solid var(--gold);
    border-radius: var(--radius-pill);
    font-weight: 800;
    font-family: var(--font-body);
    letter-spacing: .05em;
    margin: .75rem 0 1.5rem;
}

/* ── FOOTER ──────────────────────────────────────────────────── */
.site-footer {
    background: var(--charcoal);
    color: rgba(255,255,255,.8);
    margin-top: 3rem;
    padding: 2.5rem 0 1.25rem;
    border-top: 3px solid var(--gold);
}
.footer-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
@media (min-width: 720px) { .footer-inner { grid-template-columns: repeat(3, 1fr); } }
.site-footer strong { color: #fff; display: block; margin-bottom: .4rem; font-family: var(--font-brand); font-weight: 700; }
.site-footer a { color: var(--gold); }
.site-footer a:hover { color: var(--gold-light); }
.site-footer .muted { color: rgba(255,255,255,.6); }
.footer-meta {
    grid-column: 1 / -1;
    padding-top: 1rem;
    font-size: .82rem;
    color: rgba(255,255,255,.5);
    text-align: center;
}

/* ── RESPONSIVE — MOBILE ─────────────────────────────────────── */
@media (max-width: 768px) {
    /* Header */
    .nav-link { display: none; }
    .hdr, .header-inner { padding-left: 1rem; padding-right: 1rem; }
    .brand-tag { display: none; }
    .brand-name { font-size: .95rem; }
    .brand-mark, .brand-mark img, .brand-mark svg { width: 40px; height: 40px; }
    .cart-link { height: 38px; padding: 0 .85rem 0 .7rem; font-size: .8rem; }
    /* Hero */
    .hero-tiles { padding: 1.5rem 1rem; }
    .hero-tile-card { padding: 1rem 1.25rem; width: calc(100% - 2rem); max-width: 400px; }
    .hero-content-wrap { padding: 1.5rem 1rem 2rem; }
    .hero-content h1 { font-size: 1.75rem; }
    /* Container */
    .container { padding: 0 1rem; }
    /* Pills: horizontal scroll contained */
    .cat-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: .4rem;
        padding-bottom: .5rem;
    }
    .cat-pills::-webkit-scrollbar { display: none; }
    .pill { flex-shrink: 0; }
    /* Product grid: 2 cols */
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
    .product-body { padding: .75rem .8rem .85rem; }
    .product-name { font-size: .88rem; }
    .price { font-size: 1.1rem; }
    .product-card .add-form .btn { width: 44px; height: 44px; }
    /* Section title */
    .cat-title { font-size: 1.1rem; }
    /* Catalogue */
    .catalogue { padding: 1.5rem 0 2.5rem; }
    .cat-block { margin-bottom: 2rem; }
}
@media (max-width: 380px) {
    .hero-content h1 { font-size: 1.45rem; }
    .product-grid { gap: .5rem; }
    .product-body { padding: .65rem .7rem .7rem; }
}

/* Shop layout with category sidebar */
.shop-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.category-nav {
    flex: 0 0 200px;
    position: sticky;
    top: 80px;
}

.category-nav__title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted, #888);
    margin-bottom: 0.5rem;
}

.category-nav__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-nav__item > a,
.category-nav__item > .category-nav__sub li a {
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    font-size: 0.95rem;
    transition: background 0.15s;
}

.category-nav__item > a:hover,
.category-nav__sub li a:hover {
    background: var(--bg-hover, #f3f3f3);
}

.category-nav__item.is-active > a,
.category-nav__sub li.is-active a {
    background: var(--accent, #2563eb);
    color: #fff;
    font-weight: 600;
}

.category-nav__sub {
    list-style: none;
    padding: 0 0 0 1rem;
    margin: 0.2rem 0 0.4rem;
}

.shop-main {
    flex: 1;
    min-width: 0;
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--muted, #888);
    margin-bottom: 1rem;
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.breadcrumb a {
    color: var(--accent, #2563eb);
    text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .shop-layout { flex-direction: column; }
    .category-nav { flex: none; width: 100%; position: static; }
}

/* ── CATEGORY NAV — cohérence palette ───────────────────────── */
/* Override: remplace le bleu générique par le charcoal du site */
.category-nav__item.is-active > a,
.category-nav__sub li.is-active a {
    background: var(--charcoal);
    color: #fff;
    font-weight: 600;
}
.category-nav__item > a:hover,
.category-nav__sub li a:hover {
    background: var(--charcoal-light);
    color: var(--charcoal);
}
.breadcrumb a { color: var(--terracotta); }

/* ── FORM ACTIONS (pages auth) ───────────────────────────────── */
.form-actions { margin-top: 1.25rem; }
.form-actions .btn { width: 100%; justify-content: center; }

/* ── ORDER STATUS BADGES ──────────────────────────────────────── */
.order-badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: var(--radius-pill);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.order-badge-blue  { background: var(--azul-pale); color: var(--azul-dark); border: 1px solid var(--azul-light); }
.order-badge-green { background: #E6F4EA; color: #2D6A38; border: 1px solid #B7DFC0; }
.order-badge-gray  { background: var(--charcoal-light); color: var(--charcoal-mid); border: 1px solid #C8CACC; }

/* ── ACCOUNT TABLE ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.table th {
    text-align: left;
    padding: .5rem .75rem;
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1.5px solid var(--border);
}
.table td {
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table code {
    font-family: monospace;
    font-size: .85rem;
    background: var(--bg-subtle);
    padding: .15rem .4rem;
    border-radius: var(--radius-sm);
    color: var(--charcoal);
}

/* ── ORDER SUCCESS PAGE ──────────────────────────────────────── */
.success-wrap { padding-bottom: 4rem; }
.recap {
    max-width: 640px;
    margin: 0 auto 2rem;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.recap h2 {
    font-family: var(--font-brand);
    font-size: 1.1rem;
    color: var(--charcoal);
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1.5px dashed var(--border);
}
.recap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}
@media (max-width: 520px) { .recap-grid { grid-template-columns: 1fr; } }
.recap-grid h3 { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: .35rem; }
.recap-notes { grid-column: 1 / -1; }
.success-actions {
    text-align: center;
    margin: 0 auto 2rem;
}
