/* ============================================================
   Marché Pro — Catalogue en ligne
   Thème : Épicerie artisanale · Chaleureux · Premium · Linen
   ============================================================ */

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

:root {
  --linen:      #F7F0E3;
  --linen-dark: #EDE2CC;
  --linen-deep: #DDD0B0;
  --terra:      #B85C35;
  --terra-light:#D4734E;
  --terra-pale: #F5E8E2;
  --olive:      #5A6B38;
  --olive-light:#7A8F52;
  --olive-pale: #EEF2E6;
  --gold:       #C9982A;
  --gold-light: #E8C550;
  --brown:      #3D2410;
  --brown-mid:  #7A4A28;
  --brown-soft: #A07050;
  --muted:      #7A6855;
  --white:      #FFFFFF;
  --shadow:     0 2px 16px rgba(61,36,16,.1);
  --shadow-md:  0 6px 28px rgba(61,36,16,.14);
  --radius:     10px;
  --radius-sm:  6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--linen);
  color: var(--brown);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── HEADER ─────────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--linen-deep);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(61,36,16,.06);
}
.header-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; gap: 20px;
  height: 64px;
}
.site-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem; font-weight: 700;
  color: var(--brown); white-space: nowrap;
}
.site-logo span { font-size: 26px; }
.site-tagline {
  font-size: .78rem; color: var(--muted); font-weight: 300;
  padding-left: 16px; border-left: 1px solid var(--linen-deep);
}

.header-search {
  flex: 1; max-width: 380px;
  position: relative;
}
.header-search input {
  width: 100%; padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--linen-deep);
  border-radius: 20px; font-size: .88rem;
  background: var(--linen); color: var(--brown);
  transition: border-color .2s, background .2s;
}
.header-search input:focus { outline: none; border-color: var(--terra); background: var(--white); }
.header-search .si { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 16px; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.btn-cart {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  background: var(--terra);
  color: var(--white);
  border: none; border-radius: 20px;
  font-size: .85rem; font-weight: 600;
  transition: background .2s, transform .2s;
  position: relative;
}
.btn-cart:hover { background: var(--terra-light); transform: translateY(-1px); }
.cart-count {
  background: var(--gold); color: var(--brown);
  width: 20px; height: 20px; border-radius: 50%;
  font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* ── HERO BANNER ────────────────────────────────────────────── */
.hero-banner {
  background: linear-gradient(135deg, var(--brown) 0%, #5C3420 50%, var(--olive) 100%);
  color: var(--white);
  padding: 52px 24px;
  text-align: center;
  position: relative; overflow: hidden;
}
.hero-banner::before {
  content: '🫒        🌰        🍇        🍑        🥜        🫒        🌰        🍇';
  position: absolute; top: 10px; left: 0; right: 0;
  font-size: 1.2rem; opacity: .08; letter-spacing: 20px;
  white-space: nowrap; overflow: hidden;
}
.hero-banner::after {
  content: '🫒        🌰        🍇        🍑        🥜        🫒        🌰        🍇';
  position: absolute; bottom: 10px; left: 0; right: 0;
  font-size: 1.2rem; opacity: .08; letter-spacing: 20px;
  white-space: nowrap; overflow: hidden;
}
.banner-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700; line-height: 1.15;
  margin-bottom: 10px;
  position: relative; z-index: 1;
}
.banner-title em { color: var(--gold-light); font-style: italic; }
.banner-sub {
  font-size: .92rem; color: rgba(247,240,227,.75);
  font-weight: 300; position: relative; z-index: 1;
  margin-bottom: 20px;
}
.banner-badges {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.banner-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; color: rgba(247,240,227,.8);
}

/* ── MAIN LAYOUT ────────────────────────────────────────────── */
.main-wrapper {
  max-width: 1240px; margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
}

/* ── SIDEBAR FILTERS ────────────────────────────────────────── */
.sidebar-filters {
  position: sticky; top: 80px; height: fit-content;
}
.filter-section { background: var(--white); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.filter-title { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.cat-filter-list { display: flex; flex-direction: column; gap: 4px; }
.cat-filter-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: .85rem; color: var(--muted); background: none; border: none;
  text-align: left; width: 100%;
  transition: background .15s, color .15s;
}
.cat-filter-btn:hover { background: var(--linen); color: var(--brown); }
.cat-filter-btn.active { background: var(--terra-pale); color: var(--terra); font-weight: 600; }
.cat-filter-count { font-size: .72rem; color: var(--muted); background: var(--linen); padding: 1px 5px; border-radius: 8px; }
.cat-filter-btn.active .cat-filter-count { background: var(--terra); color: var(--white); }

.marchés-info { font-size: .8rem; color: var(--muted); line-height: 1.6; }
.marche-item { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.marche-item::before { content: '📍'; font-size: 12px; flex-shrink: 0; margin-top: 1px; }

/* ── PRODUCTS AREA ──────────────────────────────────────────── */
.products-area {}
.products-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.products-count { font-size: .85rem; color: var(--muted); }
.products-sort select {
  padding: 6px 10px;
  border: 1.5px solid var(--linen-deep);
  border-radius: var(--radius-sm);
  font-size: .83rem; color: var(--brown);
  background: var(--white);
}
.products-sort select:focus { outline: none; border-color: var(--terra); }

/* ── PRODUCT GRID ───────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.product-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.product-card.out-of-stock { opacity: .6; }

.product-img {
  width: 100%; aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--linen) 0%, var(--linen-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 52px; position: relative;
  overflow: hidden;
}
.product-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(61,36,16,.08));
}
.product-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 8px; border-radius: 3px;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; z-index: 1;
}
.badge-fav  { background: var(--gold); color: var(--brown); }
.badge-rupt { background: var(--brown); color: var(--white); }
.badge-new  { background: var(--olive); color: var(--white); }

.product-info { padding: 14px 14px 12px; }
.product-cat {
  font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--terra); margin-bottom: 4px;
}
.product-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem; font-weight: 700; color: var(--brown);
  line-height: 1.2; margin-bottom: 4px;
}
.product-origine { font-size: .75rem; color: var(--muted); margin-bottom: 8px; }
.product-desc { font-size: .78rem; color: var(--muted); line-height: 1.5; margin-bottom: 10px; }

.product-pricing {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px;
}
.price-main { font-size: 1.1rem; font-weight: 700; color: var(--terra); }
.price-100g { font-size: .78rem; color: var(--muted); }

/* Quantity selector in card */
.product-qte {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px;
}
.qte-chip {
  padding: 4px 8px;
  border: 1.5px solid var(--linen-deep);
  border-radius: 14px;
  font-size: .75rem; font-weight: 600; color: var(--muted);
  background: none; transition: all .15s;
}
.qte-chip:hover { border-color: var(--terra); color: var(--terra); }
.qte-chip.active { background: var(--terra); border-color: var(--terra); color: var(--white); }

.btn-add {
  width: 100%; padding: 10px;
  background: var(--olive);
  color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 600;
  transition: background .2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-add:hover { background: var(--olive-light); }
.btn-add:disabled { background: var(--linen-deep); color: var(--muted); cursor: not-allowed; }

/* ── SECTION TITLES ─────────────────────────────────────────── */
.cat-section { margin-bottom: 40px; }
.cat-section-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 2px solid var(--linen-deep);
}
.cat-section-icon { font-size: 26px; }
.cat-section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem; font-weight: 700;
  color: var(--brown);
}
.cat-section-color { height: 3px; flex: 1; border-radius: 2px; }

/* ── CART SIDEBAR ───────────────────────────────────────────── */
.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(61,36,16,.5);
  z-index: 200;
  display: none;
  backdrop-filter: blur(3px);
}
.cart-overlay.open { display: block; }

.cart-sidebar {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: var(--white);
  z-index: 201;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.25,.46,.45,.94);
  box-shadow: -8px 0 40px rgba(61,36,16,.2);
}
.cart-sidebar.open { transform: translateX(0); }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--linen-deep);
  background: var(--linen);
}
.cart-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem; font-weight: 700; color: var(--brown);
}
.cart-close {
  background: none; border: none; font-size: 22px;
  color: var(--muted); padding: 4px;
  transition: color .2s;
}
.cart-close:hover { color: var(--terra); }

.cart-items { flex: 1; overflow-y: auto; padding: 16px; }
.cart-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.cart-empty-icon { font-size: 52px; margin-bottom: 12px; display: block; }

.cart-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--linen);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-emoji { font-size: 28px; flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: .88rem; font-weight: 600; color: var(--brown); }
.cart-item-sub { font-size: .75rem; color: var(--muted); margin-top: 1px; }
.cart-item-price { font-size: .92rem; font-weight: 700; color: var(--terra); white-space: nowrap; }
.cart-item-del { background: none; border: none; color: var(--linen-deep); font-size: 18px; padding: 2px; transition: color .2s; }
.cart-item-del:hover { color: var(--terra); }

.cart-footer {
  border-top: 2px solid var(--linen-deep);
  padding: 16px;
  background: var(--linen);
}
.cart-totals { margin-bottom: 14px; }
.cart-total-row {
  display: flex; justify-content: space-between;
  padding: 5px 0; font-size: .9rem;
}
.cart-total-row.final {
  font-size: 1.2rem; font-weight: 700;
  border-top: 1.5px solid var(--linen-deep);
  padding-top: 10px; margin-top: 6px;
  color: var(--brown);
}
.cart-min-info { font-size: .78rem; color: var(--muted); text-align: center; margin-bottom: 10px; }
.btn-checkout {
  width: 100%; padding: 14px;
  background: var(--terra); color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-size: .92rem; font-weight: 700;
  transition: background .2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-checkout:hover { background: var(--terra-light); }
.btn-checkout:disabled { background: var(--linen-deep); color: var(--muted); cursor: not-allowed; }

/* ── ORDER MODAL ────────────────────────────────────────────── */
.order-overlay {
  position: fixed; inset: 0;
  background: rgba(61,36,16,.6);
  z-index: 300; display: none;
  backdrop-filter: blur(4px);
  overflow-y: auto; padding: 20px;
}
.order-overlay.open { display: flex; align-items: flex-start; justify-content: center; }
.order-modal {
  background: var(--white);
  border-radius: 16px;
  width: min(600px, 100%);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(61,36,16,.3);
  margin: auto;
}
.order-modal-header {
  background: linear-gradient(135deg, var(--brown), #5C3420);
  color: var(--white); padding: 24px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.order-modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem; font-weight: 700;
}
.order-modal-close {
  background: rgba(255,255,255,.15); border: none;
  color: var(--white); font-size: 18px; padding: 6px 10px;
  border-radius: 4px; transition: background .2s;
}
.order-modal-close:hover { background: rgba(255,255,255,.25); }

.order-form-inner { padding: 28px; }
.order-summary {
  background: var(--linen); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 24px;
}
.order-summary-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.order-summary-items { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.order-summary-item { display: flex; justify-content: space-between; font-size: .85rem; }
.order-summary-total { display: flex; justify-content: space-between; font-weight: 700; font-size: .95rem; border-top: 1px solid var(--linen-deep); padding-top: 8px; margin-top: 6px; }

.oform-row { display: flex; gap: 14px; margin-bottom: 16px; }
.oform-group { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.oform-label { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.oform-input, .oform-select, .oform-textarea {
  padding: 10px 12px;
  border: 1.5px solid var(--linen-deep);
  border-radius: var(--radius-sm);
  font-size: .9rem; color: var(--brown);
  background: var(--white);
  transition: border-color .2s;
  width: 100%;
}
.oform-input:focus, .oform-select:focus, .oform-textarea:focus { outline: none; border-color: var(--terra); }
.oform-textarea { resize: vertical; min-height: 80px; }

.btn-order-submit {
  width: 100%; padding: 15px;
  background: var(--terra); color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 700; letter-spacing: .04em;
  transition: background .2s; margin-top: 20px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-order-submit:hover { background: var(--terra-light); }
.btn-order-submit:disabled { background: var(--linen-deep); color: var(--muted); cursor: not-allowed; }

/* ── ORDER SUCCESS ──────────────────────────────────────────── */
.order-success { display: none; padding: 48px 28px; text-align: center; }
.success-icon { font-size: 72px; margin-bottom: 16px; display: block; }
.success-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem; font-weight: 700; color: var(--brown); margin-bottom: 10px;
}
.success-text { font-size: .92rem; color: var(--muted); line-height: 1.7; max-width: 380px; margin: 0 auto 24px; }
.success-ref { font-size: .82rem; color: var(--terra); font-weight: 600; }
.btn-success { padding: 12px 28px; background: var(--olive); color: var(--white); border: none; border-radius: var(--radius-sm); font-size: .88rem; font-weight: 600; }

/* ── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--brown); color: rgba(247,240,227,.7);
  padding: 36px 24px 20px; margin-top: 60px;
  text-align: center;
}
.footer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem; font-weight: 700; color: var(--gold-light);
  margin-bottom: 8px;
}
.footer-marchés { font-size: .82rem; margin-bottom: 12px; line-height: 1.7; }
.footer-bottom { font-size: .75rem; border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; margin-top: 14px; }
.footer-bottom a { color: var(--gold-light); }

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--brown); color: var(--white);
  padding: 12px 22px; border-radius: 24px;
  font-size: .88rem; font-weight: 500;
  z-index: 500; box-shadow: var(--shadow-md);
  transition: transform .3s cubic-bezier(.25,.46,.45,.94);
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── MOBILE ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .main-wrapper { grid-template-columns: 1fr; }
  .sidebar-filters { position: static; }
  .cat-filter-list { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .cat-filter-btn { padding: 6px 12px; border-radius: 16px; background: var(--white); border: 1.5px solid var(--linen-deep); }
  .cat-filter-btn.active { background: var(--terra-pale); border-color: var(--terra); }
}
@media (max-width: 600px) {
  .header-inner { padding: 0 14px; gap: 10px; }
  .site-tagline { display: none; }
  .header-search { max-width: none; }
  .main-wrapper { padding: 18px 14px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero-banner { padding: 36px 16px; }
  .oform-row { flex-direction: column; }
  .cart-sidebar { width: 100%; }
}
@media (max-width: 380px) {
  .products-grid { grid-template-columns: 1fr; }
}
