/* ============================================================
   BOUTIQUE — CSS  |  Design : épicerie fine / marché artisan
   Palette terracotta + crème + vert sauge
   Typo : Cormorant Garamond (titres) + Jost (corps)
   ============================================================ */

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

/* ---- Tokens ---- */
:root {
  --bg:         #f5f1eb;
  --bg2:        #ede8e0;
  --surface:    #fdfaf6;
  --border:     #ddd5c8;
  --border2:    #c9bfb0;
  --text:       #2c2416;
  --muted:      #7a6e62;
  --primary:    #b85c2a;   /* terracotta */
  --primary-d:  #943f18;
  --primary-l:  #f5e4d8;
  --green:      #4a6741;   /* sauge */
  --green-l:    #deebd9;
  --gold:       #c49a3c;
  --danger:     #a83030;
  --danger-l:   #fde8e8;
  --info:       #2d5f8a;
  --info-l:     #ddeeff;
  --radius:     8px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 4px rgba(44,36,22,.08);
  --shadow:     0 4px 20px rgba(44,36,22,.10);
  --shadow-lg:  0 8px 40px rgba(44,36,22,.15);
  --font-head:  'Cormorant Garamond', Georgia, serif;
  --font-body:  'Jost', system-ui, sans-serif;
  --max-w:      1240px;
  --transition: .18s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.65; font-weight: 300; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-d); }
img { max-width: 100%; height: auto; display: block; }
input, button, select, textarea { font-family: var(--font-body); }

/* ---- Layout ---- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 0; gap: 1.5rem;
}
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-img {
  display: block;
  height: 45px;
  width: auto;
  object-fit: contain;
}
.logo-name {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .02em;
  line-height: 1;
}
.logo span { color: var(--primary); }
.main-nav { display: flex; align-items: center; gap: 1.6rem; }
.main-nav a {
  font-size: .82rem; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
  padding: .3rem 0; border-bottom: 2px solid transparent;
  transition: all var(--transition);
}
.main-nav a:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* ---- Bouton hamburger (mobile) ---- */
.nav-toggle {
  display: none !important;
  align-items: center; gap: .5rem;
  padding: .4rem .7rem;
  background: none; border: 1.5px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.nav-toggle:hover { background: var(--bg2); border-color: var(--border2); }
.nav-toggle-label {
  font-family: var(--font-body);
  font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text);
}
.nav-toggle-bars {
  display: flex; flex-direction: column;
  justify-content: center; gap: 4px;
  width: 20px; height: 20px;
}
.nav-toggle-bars span {
  display: block; width: 100%; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-toggle.open .nav-toggle-bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-toggle-bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.cart-link { position: relative; }
.cart-badge {
  position: absolute; top: -9px; right: -14px;
  background: var(--primary); color: #fff;
  font-size: .6rem; font-weight: 700; border-radius: 99px;
  padding: 0 5px; min-width: 18px; line-height: 18px; text-align: center;
}
.lang-switch {
  border: 1px solid var(--border2); padding: .2rem .5rem;
  border-radius: 4px; font-size: .72rem; font-weight: 600;
  color: var(--muted); transition: all var(--transition);
}
.lang-switch:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============================================================
   HERO BANNER (vitrine)
   ============================================================ */
/* ── Shop hero ── */
.shop-hero {
    position: relative;
    height: 180px;
    overflow: hidden;
    border-radius: 0;
}
.shop-hero-photos {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 2px;
}
.shop-hero-photos img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.45) saturate(0.8);
}
.shop-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10,10,10,0.72) 0%, rgba(10,10,10,0.38) 60%, rgba(10,10,10,0.18) 100%);
}
.shop-hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}
.shop-hero-text h1 {
    font-size: 2rem;
    font-weight: 500;
    color: #fff;
    margin: 0 0 6px;
}
.shop-hero-text p {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.72);
    margin: 0;
    letter-spacing: 0.04em;
}
.shop-hero-logo {
    position: absolute;
    right: 25%; /* à cheval sur les 2 dernières photos (50% de la droite) */
    top: 50%;
    transform: translate(50%, -50%);
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 8px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    z-index: 3;
}
.shop-hero-logo img {
    height: 68px; /* 45 × 1.5 */
    width: auto;
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.shop-toolbar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1rem 1.2rem;
  margin-bottom: 2rem; box-shadow: var(--shadow-sm);
}
.search-form { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.search-form input[type="search"] {
  flex: 1; min-width: 180px;
  background: var(--bg); border-color: var(--border);
}
.search-form select { min-width: 150px; background: var(--bg); }
.empty-state {
  text-align: center; color: var(--muted); padding: 5rem 1rem;
  font-size: 1.1rem; font-family: var(--font-head); font-style: italic;
}

/* ============================================================
   GRILLE PRODUITS
   ============================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.6rem;
}
.product-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.product-card.out-of-stock { opacity: .7; }

.product-card-img {
  position: relative; overflow: hidden;
  background: var(--bg2); aspect-ratio: 4/3;
}
.product-card-img img {
  width: 100%; height: 100%; object-fit: contain;
  background: var(--surface);
  transition: transform .4s ease;
}
.product-card:hover .product-card-img img { transform: scale(1.05); }
.product-card-img .no-img {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--border2);
}

.product-card-body { padding: 1.1rem 1.2rem 1.2rem; flex: 1; display: flex; flex-direction: column; }
.product-card-cat {
  font-size: .68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; color: var(--primary); margin-bottom: .35rem;
}
.product-card-body h3 {
  font-family: var(--font-head); font-size: 1.15rem; font-weight: 600;
  color: var(--text); line-height: 1.3; margin-bottom: .5rem; flex: 1;
}
.product-card-body h3 a { color: inherit; }
.product-card-body h3 a:hover { color: var(--primary); }
.product-price {
  font-size: 1.1rem; font-weight: 600; color: var(--primary); margin-bottom: .8rem;
}
.tax-hint { font-size: .7rem; font-weight: 300; color: var(--muted); }

.product-card-actions { display: flex; gap: .5rem; align-items: center; margin-top: auto; }
.product-card-actions .qty-input { width: 60px !important; }

.badge-out {
  display: inline-block; padding: .3rem .8rem;
  background: var(--danger-l); color: var(--danger);
  border-radius: 4px; font-size: .75rem; font-weight: 600;
}
.badge-out.large { font-size: .9rem; }

/* ============================================================
   FICHE PRODUIT
   ============================================================ */
.product-detail { max-width: 980px; }
.back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--muted); font-size: .85rem; margin-bottom: 1.5rem;
  transition: color var(--transition);
}
.back-link:hover { color: var(--primary); }

.product-detail-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start;
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 2rem; box-shadow: var(--shadow);
}
.product-image-wrap {
  border-radius: var(--radius); overflow: hidden;
  background: var(--bg2); aspect-ratio: 1;
}
.product-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-image-wrap .no-img {
  width: 100%; height: 100%; min-height: 280px;
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem; color: var(--border2);
}

.product-cat {
  font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; color: var(--primary);
}
.product-info h1 {
  font-family: var(--font-head); font-size: 2rem; font-weight: 700;
  line-height: 1.2; margin: .5rem 0 1rem;
}
.product-price-lg {
  font-size: 1.6rem; font-weight: 600; color: var(--primary); margin-bottom: 1rem;
}
.product-meta {
  font-size: .85rem; color: var(--muted); margin-bottom: .4rem;
  display: flex; align-items: center; gap: .4rem;
}
.add-to-cart-form {
  display: flex; align-items: center; gap: .8rem;
  margin-top: 1.6rem; flex-wrap: wrap;
}
.add-to-cart-form label { font-size: .83rem; font-weight: 500; color: var(--muted); }

.product-description {
  margin-top: 2.5rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.8rem 2rem;
}
.product-description h2 {
  font-family: var(--font-head); font-size: 1.4rem; margin-bottom: 1rem;
}
.description-text { font-size: .95rem; line-height: 1.8; color: #3a3028; }

/* ============================================================
   PANIER
   ============================================================ */
.cart-header { margin-bottom: 1.5rem; }
.cart-header h1 { font-family: var(--font-head); font-size: 2rem; }

/* ---- Cartes articles ---- */
.cart-items {
  display: flex; flex-direction: column; gap: .8rem;
  margin-bottom: 1.5rem;
}
.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: .9rem;
  align-items: start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.cart-thumb {
  width: 72px; height: 72px; object-fit: contain;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg2);
}
.cart-item-info {
  min-width: 0;
  display: flex; flex-direction: column; gap: .22rem;
}
.cart-item-name {
  font-weight: 500; font-size: .92rem; color: var(--text);
  line-height: 1.35; word-break: break-word;
}
.cart-item-name:hover { color: var(--primary); }
.cart-item-sku   { font-size: .73rem; color: var(--muted); }
.cart-item-price { font-size: .8rem;  color: var(--muted); }

.cart-item-right {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: .45rem;
  min-width: 80px;
}
.cart-item-subtotal {
  font-weight: 700; font-size: .95rem; color: var(--primary);
  white-space: nowrap;
}
.qty-input {
  width: 62px !important; text-align: center;
  padding: .35rem .4rem;
}

/* ---- Actions globales ---- */
.cart-actions {
  display: flex; gap: .8rem;
  margin-bottom: 2rem; flex-wrap: wrap;
}

/* ---- Récapitulatif ---- */
.cart-summary {
  max-width: 420px; margin-left: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.4rem; box-shadow: var(--shadow);
}
.cart-summary h3 {
  font-family: var(--font-head); font-size: 1.2rem; margin-bottom: 1rem;
}
.summary-line {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .5rem 0; font-size: .9rem; border-bottom: 1px solid var(--border);
  gap: .5rem;
}
.summary-line:last-of-type { border-bottom: none; }
.summary-line.total {
  font-size: 1.1rem; font-weight: 700; color: var(--text); padding-top: .85rem;
}
.free-shipping { color: var(--green); font-weight: 600; }
.cart-shipping-note {
  font-size: .78rem; color: var(--muted); font-style: italic;
  text-align: right; max-width: 200px;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .cart-item {
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
  }
  .cart-thumb { width: 56px; height: 56px; }
  .cart-item-right {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: .6rem; margin-top: .2rem;
  }
  .cart-summary { max-width: 100%; }
  .cart-actions { flex-direction: column; }
  .cart-actions .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   CHECKOUT
   ============================================================ */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2.5rem; align-items: start; }
.checkout-form fieldset {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.checkout-form fieldset legend {
  font-family: var(--font-head); font-size: 1.1rem; font-weight: 600;
  padding: 0 .5rem; color: var(--text);
}
.order-summary {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.6rem;
  position: sticky; top: 80px; box-shadow: var(--shadow);
}
.order-summary h3 { font-family: var(--font-head); font-size: 1.3rem; margin-bottom: 1.2rem; }
.summary-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  font-size: .88rem; padding: .5rem 0; border-bottom: 1px solid var(--border);
  gap: .5rem;
}
.summary-item:last-of-type { border-bottom: none; }
.action-bar { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.4rem; align-items: center; }

/* ============================================================
   RETOUR PAIEMENT
   ============================================================ */
.payment-return {
  text-align: center; padding: 5rem 1rem; max-width: 520px; margin: 0 auto;
}
.payment-icon { font-size: 5rem; margin-bottom: 1.5rem; line-height: 1; }
.payment-return h1 { font-family: var(--font-head); font-size: 1.8rem; margin-bottom: 1.5rem; }
.order-recap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.4rem; margin: 1.5rem 0; text-align: left;
}
.order-recap p { margin-bottom: .5rem; font-size: .95rem; }

/* ============================================================
   AUTH
   ============================================================ */
.auth-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.auth-box {
  width: 100%; max-width: 440px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.5rem 2rem; box-shadow: var(--shadow);
}
.auth-box h1 { font-family: var(--font-head); font-size: 1.8rem; margin-bottom: 1.6rem; }
.auth-alt { margin-top: 1.4rem; font-size: .88rem; color: var(--muted); text-align: center; }
.auth-alt a { font-weight: 500; }

/* ============================================================
   COMPTE CLIENT
   ============================================================ */
.account-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; align-items: start; }
.account-nav {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: .8rem; box-shadow: var(--shadow-sm);
  position: sticky; top: 80px;
}
.account-nav a {
  display: block; padding: .65rem 1rem; border-radius: var(--radius);
  font-size: .88rem; font-weight: 500; color: var(--muted);
  transition: all var(--transition); text-decoration: none; margin-bottom: .2rem;
}
.account-nav a.active, .account-nav a:hover { background: var(--primary-l); color: var(--primary); }
.account-nav a:last-child { color: var(--danger); margin-top: .5rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.account-nav a:last-child:hover { background: var(--danger-l); color: var(--danger); }
.account-content h2 { font-family: var(--font-head); font-size: 1.5rem; margin-bottom: 1.4rem; }

/* ============================================================
   DÉTAIL COMMANDE
   ============================================================ */
.order-detail { max-width: 900px; }
.order-detail h1 { font-family: var(--font-head); font-size: 1.6rem; margin-bottom: 1rem; }
.order-meta {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.4rem;
  margin-bottom: 1.5rem; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem .5rem;
}
.order-meta p { font-size: .9rem; }

/* ============================================================
   FORMULAIRES COMMUNS
   ============================================================ */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block; font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: .4rem; color: var(--muted);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="search"],
input[type="file"], select, textarea {
  width: 100%; padding: .65rem 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font-size: .92rem; font-family: var(--font-body);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(184,92,42,.12);
}
input:hover, select:hover { border-color: var(--border2); }
textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.input-disabled { background: var(--bg2); color: var(--muted); cursor: not-allowed; }
.qty-input { width: 72px !important; text-align: center; padding-left: .5rem; padding-right: .5rem; }

.checkbox-group label { display: flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .9rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.checkbox-group input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.radio-label { display: flex; align-items: center; gap: .7rem; cursor: pointer; margin-bottom: .8rem; font-size: .92rem; padding: .7rem 1rem; border: 1.5px solid var(--border); border-radius: var(--radius); transition: all var(--transition); }
.radio-label:hover { border-color: var(--primary); background: var(--primary-l); }
.radio-label input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-family: var(--font-body); font-weight: 500; font-size: .85rem;
  letter-spacing: .04em; padding: .6rem 1.3rem;
  border-radius: var(--radius); border: 1.5px solid transparent;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; white-space: nowrap; line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--primary);  color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px rgba(184,92,42,.25); }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); box-shadow: 0 4px 16px rgba(184,92,42,.35); color:#fff; }
.btn-secondary { background: var(--green);    color: #fff; border-color: var(--green); box-shadow: 0 2px 8px rgba(74,103,65,.2); }
.btn-secondary:hover { filter: brightness(1.1); color:#fff; }
.btn-outline   { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger    { background: var(--danger);   color: #fff; border-color: var(--danger); }
.btn-danger:hover { filter: brightness(.9); color:#fff; }
.btn-ghost     { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg2); color: var(--text); }

.btn-sm    { font-size: .75rem; padding: .38rem .85rem; }
.btn-large { font-size: .95rem; padding: .8rem 1.8rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; pointer-events: none; }

/* ============================================================
   ALERTES
   ============================================================ */
.alert {
  padding: .85rem 1.1rem; border-radius: var(--radius);
  margin-bottom: 1.2rem; font-size: .9rem; border-left: 4px solid;
}
.alert-success { background: var(--green-l);  color: var(--green);  border-color: var(--green); }
.alert-danger  { background: var(--danger-l); color: var(--danger); border-color: var(--danger); }
.alert-info    { background: var(--info-l);   color: var(--info);   border-color: var(--info); }
.alert ul { margin: .4rem 0 0 1.2rem; }

/* ============================================================
   TABLES DONNÉES
   ============================================================ */
.data-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-sm);
}
.data-table th, .data-table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); text-align: left; }
.data-table thead { background: var(--bg2); }
.data-table th { font-weight: 600; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; }
.data-table tbody tr:hover { background: var(--bg); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tfoot td { border-top: 2px solid var(--border); border-bottom: none; font-size: .9rem; background: var(--bg2); }
.data-table tfoot .total-row td { font-weight: 700; font-size: 1rem; color: var(--primary); }
.row-inactive { opacity: .5; }

/* ============================================================
   BADGES STATUTS
   ============================================================ */
.status-badge {
  display: inline-block; padding: .22rem .75rem; border-radius: 99px;
  font-size: .72rem; font-weight: 600; letter-spacing: .04em;
}
.status-pending    { background: #fef3c7; color: #92400e; }
.status-paid       { background: var(--green-l); color: var(--green); }
.status-processing { background: #dbeafe; color: #1e40af; }
.status-shipped    { background: #ede9fe; color: #5b21b6; }
.status-ready      { background: #cffafe; color: #164e63; }
.status-completed  { background: var(--green-l); color: var(--green); }
.status-cancelled  { background: var(--danger-l); color: var(--danger); }
.status-refunded   { background: #fae8ff; color: #6b21a8; }

.badge-info    { background: #dbeafe; color: #1e40af; font-size: .75rem; padding: .2rem .6rem; border-radius: 4px; }
.badge-warning { background: #fef3c7; color: #92400e; font-size: .75rem; padding: .2rem .6rem; border-radius: 4px; }
.badge-danger  { background: var(--danger-l); color: var(--danger); font-size: .75rem; padding: .2rem .6rem; border-radius: 4px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #2c2416; color: rgba(245,241,235,.6);
  margin-top: 4rem; padding: 2rem 0; text-align: center;
  font-size: .83rem;
}
.site-footer a { color: rgba(245,241,235,.6); }
.site-footer a:hover { color: var(--primary); }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-body  { background: #f0f4f8; }
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 230px; flex-shrink: 0;
  background: #1a2332; color: #c5cedd;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-logo {
  padding: 1.5rem 1.3rem; font-family: var(--font-head);
  font-size: 1.1rem; font-weight: 700; color: #f0f4f8;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: .5rem;
}
.admin-sidebar nav { padding: 1rem .7rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.admin-sidebar nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem 1rem; border-radius: var(--radius);
  font-size: .84rem; font-weight: 400; color: #8fa0b8;
  transition: all var(--transition); text-decoration: none;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  background: rgba(255,255,255,.08); color: #f0f4f8;
}
.admin-sidebar nav a.active { background: var(--primary); color: #fff; font-weight: 500; }
.admin-sidebar nav hr { border: none; border-top: 1px solid rgba(255,255,255,.06); margin: .5rem 0; }

.admin-main  { flex: 1; overflow-x: auto; }
.admin-content { padding: 2rem 2.5rem; }
.admin-content h1 { font-family: var(--font-head); font-size: 1.7rem; margin-bottom: 1.6rem; color: #1a2332; }
.admin-content h2 { font-family: var(--font-head); font-size: 1.3rem; margin: 2rem 0 1rem; color: #1a2332; }

/* Dashboard stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 1.1rem; margin-bottom: 2rem; }
.stat-card {
  background: #fff; border-radius: var(--radius-lg);
  padding: 1.4rem 1.2rem; text-align: center;
  border: 1px solid #e2e8f0; box-shadow: 0 1px 4px rgba(0,0,0,.05);
  border-top: 3px solid var(--border);
}
.stat-card.primary { border-top-color: var(--primary); }
.stat-card.success { border-top-color: var(--green); }
.stat-card.warning { border-top-color: var(--gold); }
.stat-card.danger  { border-top-color: var(--danger); }
.stat-value { display: block; font-size: 1.7rem; font-weight: 700; color: #1a2332; margin-bottom: .3rem; font-family: var(--font-head); }
.stat-label { display: block; font-size: .75rem; color: #64748b; }

/* Admin forms */
.admin-login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.product-form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.detail-card { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius-lg); padding: 1.2rem 1.4rem; }
.detail-card h3 { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #64748b; margin-bottom: .7rem; }
.detail-card p { font-size: .88rem; margin-bottom: .35rem; }
.filter-bar { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ============================================================
   MAIN CONTENT SPACING
   ============================================================ */
main.container { padding-top: 0; padding-bottom: 3rem; }
main.container > *:first-child:not(.shop-hero) { margin-top: 2rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .checkout-layout { grid-template-columns: 1fr; }
  .product-detail-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .product-form .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .account-layout { grid-template-columns: 1fr; }
  .account-nav { position: static; display: flex; flex-wrap: wrap; gap: .3rem; }
  .account-nav a { flex: 1; text-align: center; min-width: 100px; }
  .form-row { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  /* cart-table obsolète */


  /* Menu hamburger */
  .nav-toggle { display: flex !important; }
  .site-header { position: relative; }
  .main-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: flex-start;
    gap: 0; padding: .5rem 1.5rem 1rem;
    z-index: 199;
  }
  .main-nav.open { display: flex; }
  .main-nav a {
    padding: .65rem 0;
    border-bottom: 1px solid var(--border);
    width: 100%;
    font-size: .9rem;
    letter-spacing: .04em;
  }
  .main-nav a:last-child { border-bottom: none; }
}
@media (max-width: 520px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .product-card-body { padding: .8rem; }
  .product-card-body h3 { font-size: 1rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .cart-thumb { width: 44px; height: 44px; }
  .header-inner { padding: .7rem 0; }
}

.cart-shipping-note {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
  text-align: right;
  max-width: 180px;
}

/* ============================================================
   PAGE RECHERCHE
   ============================================================ */
.search-page { max-width: 960px; margin: 2rem auto 0; }
.search-title {
  font-family: var(--font-head); font-size: 2rem;
  margin-bottom: 1.5rem;
}
.search-main-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-sm); margin-bottom: .5rem;
}
.search-input-wrap {
  display: flex; gap: .7rem; margin-bottom: .9rem;
}
.search-input-wrap input[type="search"] {
  flex: 1; font-size: 1rem; padding: .75rem 1rem;
  border-radius: var(--radius); border: 1.5px solid var(--border);
}
.search-input-wrap input[type="search"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(184,92,42,.12);
}
.search-filters { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.search-filters select { min-width: 180px; }

/* Suggestions live */
.live-suggestions {
  position: relative; z-index: 300;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; margin-bottom: 1rem;
}
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  text-decoration: none;
  color: var(--text);
  line-height: 1.4;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--primary-l); text-decoration: none; }
.sug-img {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 6px; overflow: hidden; background: var(--bg2);
}
.sug-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.no-img-sm {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; background: var(--bg2);
  border-radius: 6px; font-size: 1.3rem;
}
.sug-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.sug-name {
  display: block;
  font-weight: 500;
  font-size: .92rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sug-sku {
  display: block;
  font-size: .73rem;
  color: var(--muted);
  letter-spacing: .02em;
}
.sug-price {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--primary);
  font-size: .9rem;
  white-space: nowrap;
  align-self: center;
}

/* Résultats */
.search-results-header { margin: 1.5rem 0 1rem; }
.search-count { font-size: .95rem; color: var(--muted); }
.search-count strong { color: var(--text); }
.search-no-result { font-size: 1.05rem; color: var(--muted); margin-bottom: .5rem; }
.search-hint { font-size: .9rem; color: var(--muted); }
.search-hint a { color: var(--primary); }

/* État vide */
.search-empty-state {
  text-align: center; padding: 4rem 1rem; color: var(--muted);
}
.search-empty-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: .4; }
.search-empty-state p { font-size: 1rem; margin-bottom: 1.5rem; }

/* SKU sur les cartes */
.product-sku { font-size: .75rem; color: var(--muted); margin-bottom: .3rem; }

/* ============================================================
   GALERIE MULTI-IMAGES — FICHE PRODUIT
   ============================================================ */
.product-gallery { display: flex; flex-direction: column; gap: .8rem; }

.gallery-main {
  border-radius: var(--radius); overflow: hidden;
  background: var(--bg2); aspect-ratio: 1;
  border: 1px solid var(--border);
}
.gallery-main img {
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity .2s ease;
}

.gallery-thumbs {
  display: flex; gap: .5rem; flex-wrap: wrap;
}
.gallery-thumb {
  width: 72px; height: 72px; padding: 0;
  border: 2px solid var(--border); border-radius: 6px;
  overflow: hidden; cursor: pointer; background: var(--bg2);
  transition: border-color var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb:hover { border-color: var(--primary); transform: translateY(-2px); }
.gallery-thumb.active { border-color: var(--primary); border-width: 2.5px; }

/* ============================================================
   GALERIE ADMIN — GESTION PHOTOS
   ============================================================ */
.gallery-admin {
  display: flex; flex-wrap: wrap; gap: .8rem;
  margin-bottom: 1rem;
}
.gallery-admin-item {
  position: relative; width: 110px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--bg2);
}
.gallery-admin-item img {
  width: 110px; height: 110px; object-fit: cover; display: block;
}
.badge-main {
  display: block; width: 100%;
  background: var(--primary); color: #fff;
  font-size: .65rem; font-weight: 600; text-align: center;
  padding: .25rem .3rem;
}
.gallery-admin-actions {
  display: flex; justify-content: center; gap: .3rem;
  padding: .35rem; background: rgba(255,255,255,.92);
}
.gallery-admin-actions .btn { padding: .25rem .5rem; font-size: .72rem; }

@media (max-width: 768px) {
  .gallery-thumb { width: 56px; height: 56px; }
}

.product-stock-qty,
.product-stock-unlimited {
  color: var(--green);
  font-size: .88rem;
  font-weight: 500;
  margin-top: .5rem;
}

/* ============================================================
   VARIANTES — FICHE PRODUIT
   ============================================================ */
.variant-selector { margin: 1.2rem 0; }
.variant-label {
  display: block;
  font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-bottom: .4rem;
}
.variant-dropdown {
  width: 100%; max-width: 280px;
  padding: .65rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--transition);
}
.variant-dropdown:focus { border-color: var(--primary); }

.product-external-link {
  margin-top: 1.5rem;
}
.product-external-link .btn {
  font-size: .9rem;
}

/* ============================================================
   CORRECTIONS PRODUCT / INDEX
   ============================================================ */

/* Photo contenue dans le cadre sans coupure */
.gallery-main img {
  object-fit: contain !important;
  background: var(--bg2);
}

/* Catégorie cliquable */
.product-cat-link {
  text-decoration: none;
  transition: opacity var(--transition);
}
.product-cat-link:hover { opacity: .75; }

/* Badge featured sur les cartes */
.product-card-img { position: relative; }
.featured-badge {
  position: absolute; top: .5rem; left: .5rem;
  background: #fff;
  border-radius: 99px;
  padding: .15rem .45rem;
  font-size: .85rem;
  box-shadow: var(--shadow-sm);
  z-index: 1;
}
.product-featured { border-color: var(--gold); }

/* Variantes multi-dimensions */
.variant-row {
  display: flex; align-items: center; gap: .8rem;
  margin-bottom: .7rem;
}
.variant-row .variant-label {
  min-width: 80px; margin: 0; white-space: nowrap;
}
.variant-row .variant-dropdown { flex: 1; max-width: 260px; }


/* ---- Panier — layout carte (mobile) ---- */
.cart-items { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1.5rem; }
.cart-item {
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1rem; box-shadow: var(--shadow-sm);
}
.cart-thumb { width: 72px; height: 72px; flex-shrink: 0; object-fit: contain; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg2); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { display: block; font-weight: 500; font-size: .95rem; color: var(--text); line-height: 1.3; margin-bottom: .2rem; word-break: break-word; }
.cart-item-name:hover { color: var(--primary); }
.cart-item-sku { display: block; font-size: .75rem; color: var(--muted); margin-bottom: .3rem; }
.cart-item-price { font-size: .85rem; color: var(--muted); }
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; flex-shrink: 0; }
.cart-item-subtotal { font-weight: 700; font-size: 1rem; color: var(--primary); white-space: nowrap; }
.cart-actions { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
@media (max-width: 480px) {
  .cart-item { gap: .7rem; padding: .8rem; }
  .cart-thumb { width: 56px; height: 56px; }
  .cart-item-name { font-size: .88rem; }
}
/* ---- Bouton panier mobile : icône seule ---- */
@media (max-width: 768px) {
  .btn-add-cart .btn-add-text { display: none; }
  .btn-add-cart .btn-add-icon {
    display: inline;
    font-size: 1.3rem;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.15));
  }
  .btn-add-cart {
    padding: .6rem .9rem;
    min-width: 48px;
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 3px 10px rgba(184,92,42,.4) !important;
  }
}
@media (min-width: 769px) {
  .btn-add-cart .btn-add-icon { display: none; }
}

/* ---- Infobar maintenance ---- */
.infobar-maintenance {
  background: var(--gold);
  color: #fff;
  text-align: center;
  padding: .6rem 1.5rem;
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .02em;
}

@media (max-width: 768px) {
  .product-card-actions { justify-content: center; }
  .product-card-actions a.btn,
  .product-card-actions form { width: 100%; }
  .product-card-actions a.btn { display: flex; justify-content: center; }
}

/* Badge Sur commande */
.badge-on-order {
  display: inline-block;
  padding: .22rem .75rem;
  background: #fef3c7; color: #92400e;
  border-radius: 99px; font-size: .75rem; font-weight: 600;
}
/* Hero mobile */
@media (max-width: 768px) {
  .shop-hero { height: auto; min-height: 160px; }
  .shop-hero-photos { grid-template-columns: 1fr 1fr 1fr 1fr; } /* 4 photos conservées */
  .shop-hero-content {
    padding: 1rem 1.2rem;
    align-items: flex-start;
    flex-direction: column;
    gap: .4rem;
    justify-content: center;
  }
  .shop-hero-text h1 { font-size: 1.2rem; margin-bottom: 4px; }
  .shop-hero-text p  { font-size: .75rem; white-space: normal; line-height: 1.4; }
  .shop-hero-logo    { display: none; } /* logo retiré pour laisser la place au texte */
}