/* ================================================================
   TAFASSIL.TN — CSS Global
   Design system partagé par toutes les pages
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0E0C09;
  --surface:  #1A1611;
  --surface2: #221E17;
  --gold:     #C9A84C;
  --gold-lt:  #E2C87A;
  --gold-dim: #6B5520;
  --cream:    #F5F0E8;
  --muted:    #6B6357;
  --muted-lt: #9A8E7E;
  --serif:    'Cormorant Garamond', Georgia, serif;
  --sans:     'Space Grotesk', system-ui, sans-serif;
  --ease:     cubic-bezier(0.16, 1, 0.3, 1);
}

html  { scroll-behavior: smooth; }
body  { background: var(--bg); color: var(--cream); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }

::-webkit-scrollbar       { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); }

/* ── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  background: var(--gold);
  padding: 8px 0;
  text-align: center;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--bg);
}

/* ── NAV ─────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 34px; left: 0; right: 0;
  z-index: 200;
  padding: 18px 56px;
  transition: background .4s, padding .4s, top .3s;
}
nav.scrolled {
  background: rgba(14,12,9,.96);
  backdrop-filter: blur(16px);
  padding: 14px 56px;
  border-bottom: 1px solid rgba(201,168,76,.12);
  top: 0;
}
.nav-inner   { display: flex; align-items: center; }
.nav-logo    { font-family: var(--serif); font-size: 1.35rem; font-weight: 400; letter-spacing: .22em; text-transform: uppercase; color: var(--cream); text-decoration: none; flex-shrink: 0; }
.nav-logo span { color: var(--gold); }
.nav-links   { display: flex; align-items: center; gap: 24px; list-style: none; margin: 0 auto; }
.nav-links a { font-family: var(--sans); font-size: .7rem; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-lt); text-decoration: none; transition: color .2s; }
.nav-links a:hover { color: var(--cream); }
.nav-links .new-badge { font-size: .55rem; font-weight: 600; color: var(--bg); background: var(--gold); padding: 2px 5px; margin-left: 4px; vertical-align: middle; }
.nav-right   { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.nav-icon-btn { background: none; border: none; cursor: pointer; color: var(--muted-lt); display: flex; align-items: center; transition: color .2s; padding: 4px; }
.nav-icon-btn:hover { color: var(--gold); }
.nav-cart {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: .7rem; font-weight: 500;
  letter-spacing: .14em; color: var(--cream);
  text-decoration: none;
  border: 1px solid rgba(201,168,76,.3);
  padding: 8px 16px;
  transition: border-color .2s, color .2s;
}
.nav-cart:hover { border-color: var(--gold); color: var(--gold); }

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  background: #080705;
  padding: 56px 56px 32px;
  border-top: 1px solid rgba(201,168,76,.1);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-logo    { font-family: var(--serif); font-size: 1.3rem; font-weight: 400; letter-spacing: .22em; text-transform: uppercase; color: var(--cream); margin-bottom: 14px; display: block; }
.footer-tagline { font-family: var(--sans); font-size: .82rem; font-weight: 300; color: var(--muted); line-height: 1.7; margin-bottom: 20px; }
.footer-social  { display: flex; gap: 12px; }
.footer-social a {
  width: 36px; height: 36px;
  border: 1px solid rgba(201,168,76,.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-lt); text-decoration: none;
  font-size: .75rem; transition: border-color .2s, color .2s;
}
.footer-social a:hover { border-color: var(--gold); color: var(--gold); }
.footer-col-title {
  font-family: var(--sans); font-size: .7rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--cream);
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid rgba(201,168,76,.15);
}
.footer-col-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col-links a { font-family: var(--sans); font-size: .8rem; font-weight: 300; color: var(--muted); text-decoration: none; transition: color .2s; }
.footer-col-links a:hover { color: var(--gold-lt); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid rgba(201,168,76,.08);
}
.footer-copy         { font-family: var(--sans); font-size: .68rem; font-weight: 300; color: rgba(245,240,232,.25); }
.footer-bottom-links { display: flex; gap: 24px; }
.footer-bottom-links a { font-family: var(--sans); font-size: .67rem; font-weight: 300; letter-spacing: .1em; color: rgba(245,240,232,.2); text-decoration: none; transition: color .2s; }
.footer-bottom-links a:hover { color: var(--gold); }

/* ── PRODUCT CARD (partagée catégorie + homepage) ─────────── */
.product-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  text-decoration: none;
  transition: background .3s;
}
.product-card:hover { background: var(--surface2); }
.product-card-img   { position: relative; aspect-ratio: 1; overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.product-card:hover .product-card-img img { transform: scale(1.06); }
.product-card-badge {
  position: absolute; top: 14px; left: 14px;
  background: var(--gold); color: var(--bg);
  font-family: var(--sans); font-size: .6rem;
  font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; padding: 4px 10px; z-index: 2;
}
.product-card-badge.new      { background: var(--cream); color: var(--bg); }
.product-card-badge.promo    { background: #C62828; color: #fff; }
.product-card-badge.stock-off { background: var(--surface2); color: var(--muted); border: 1px solid rgba(201,168,76,.15); }
.product-card-quick {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--gold); color: var(--bg);
  font-family: var(--sans); font-size: .72rem;
  font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; padding: 12px; text-align: center;
  transform: translateY(100%);
  transition: transform .35s var(--ease); z-index: 3;
}
.product-card:hover .product-card-quick { transform: translateY(0); }
.product-card-info  { padding: 16px 18px 20px; flex: 1; }
.product-card-name  { font-family: var(--serif); font-size: 1.1rem; font-weight: 400; color: var(--cream); margin-bottom: 6px; }
.product-card-mat   { font-family: var(--sans); font-size: .68rem; font-weight: 300; color: var(--muted); letter-spacing: .1em; margin-bottom: 10px; line-height: 1.4; }
.product-card-cat   { font-family: var(--sans); font-size: .7rem; font-weight: 300; color: var(--muted); letter-spacing: .1em; margin-bottom: 10px; }
.product-card-price { font-family: var(--serif); font-size: 1.2rem; font-weight: 400; color: var(--gold-lt); }
.product-card-price del { font-size: .9rem; color: var(--muted); margin-left: 8px; text-decoration: line-through; }

/* ── REVEAL ANIMATION ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.visible             { opacity: 1; transform: translateY(0); }
.reveal-delay-1             { transition-delay: .07s; }
.reveal-delay-2             { transition-delay: .14s; }
.reveal-delay-3             { transition-delay: .21s; }
.reveal-delay-4             { transition-delay: .28s; }

/* ── STICKY BUY BAR (mobile) ─────────────────────────────── */
.sticky-buy {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: rgba(14,12,9,.97);
  border-top: 1px solid rgba(201,168,76,.2);
  padding: 12px 20px;
  align-items: center; justify-content: space-between; gap: 16px;
  backdrop-filter: blur(12px);
}
.sticky-buy-info    { display: flex; flex-direction: column; gap: 2px; }
.sticky-buy-name    { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--cream); }
.sticky-buy-price   { font-family: var(--serif); font-size: 1.3rem; font-weight: 300; color: var(--gold-lt); }
.sticky-buy-btn {
  background: var(--gold); color: var(--bg);
  font-family: var(--sans); font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  padding: 14px 24px; border: none; cursor: pointer; white-space: nowrap;
}

/* ── BOUTONS PARTAGÉS ────────────────────────────────────── */
.btn-gold {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--gold); color: var(--bg);
  font-family: var(--sans); font-size: .8rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  padding: 18px 40px; border: 1px solid var(--gold);
  cursor: pointer; text-decoration: none;
  transition: background .25s, color .25s;
}
.btn-gold:hover { background: transparent; color: var(--gold); }
.btn-outline {
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--muted-lt);
  font-family: var(--sans); font-size: .74rem; font-weight: 400;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 14px 40px; border: 1px solid rgba(201,168,76,.2);
  text-decoration: none;
  transition: border-color .2s, color .2s;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* ── MODAL COMMANDE ─────────────────────────────────────── */
#modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 900;
  background: rgba(8,6,4,.75); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .3s;
}
#modal-overlay.open { display: block; opacity: 1; }
#order-modal {
  display: none; position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -46%);
  z-index: 1000;
  width: min(480px, 94vw); max-height: 92vh;
  overflow-y: auto;
  background: #FAF8F4; border-radius: 4px;
  box-shadow: 0 32px 80px rgba(0,0,0,.5);
  opacity: 0;
  transition: opacity .3s, transform .35s cubic-bezier(0.16,1,0.3,1);
}
#order-modal.open { display: block; opacity: 1; transform: translate(-50%,-50%); }
#order-modal::-webkit-scrollbar       { width: 3px; }
#order-modal::-webkit-scrollbar-thumb { background: #D4AE50; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #E8E0D0;
  position: sticky; top: 0;
  background: #FAF8F4; z-index: 2;
}
#modal-title { font-family: var(--sans); font-size: 1.1rem; font-weight: 500; color: #1C1710; }
#modal-close {
  background: none; border: none; cursor: pointer;
  color: #7A6E5F; padding: 6px; border-radius: 50%;
  display: flex; align-items: center;
  transition: background .2s, color .2s;
}
#modal-close:hover { background: #E8E0D0; color: #1C1710; }
.modal-body { padding: 18px 24px 24px; }
.modal-section-title {
  font-family: var(--sans); font-size: .8rem; font-weight: 600;
  color: #1C1710; letter-spacing: .04em; text-transform: uppercase;
  padding-bottom: 8px; border-bottom: 2px solid #1C2D5E;
  margin-bottom: 14px; display: inline-block;
}
.modal-article {
  display: flex; gap: 14px; align-items: flex-start;
  margin-bottom: 18px; padding-bottom: 18px;
  border-bottom: 1px solid #E8E0D0;
}
.modal-article img  { width: 80px; height: 80px; object-fit: cover; border-radius: 2px; flex-shrink: 0; border: 1px solid #E8E0D0; }
.modal-article-info { display: flex; flex-direction: column; gap: 5px; padding-top: 4px; }
.modal-article-name  { font-family: var(--sans); font-size: .88rem; font-weight: 400; color: #3A3228; }
.modal-article-price { font-family: var(--sans); font-size: 1rem; font-weight: 700; color: #1C1710; }
#order-form { display: flex; flex-direction: column; gap: 10px; }
#order-form input, #order-form select {
  width: 100%; padding: 12px 16px;
  border: 1px solid #E0D8CC; border-radius: 50px;
  font-family: var(--sans); font-size: .86rem; color: #1C1710;
  background: #fff; outline: none;
  transition: border-color .2s;
  -webkit-appearance: none; appearance: none;
}
#order-form input::placeholder { color: #ADA49A; }
#order-form input:focus, #order-form select:focus { border-color: #B8941F; box-shadow: 0 0 0 3px rgba(184,148,31,.1); }
#order-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A6E5F' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
  padding-right: 40px; cursor: pointer; color: #ADA49A;
}
#order-form select:valid { color: #1C1710; }
.modal-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.modal-error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; padding: 10px 16px; border-radius: 8px; font-size: .83rem; }
.modal-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; padding: 10px 16px; border-radius: 8px; font-size: .83rem; }
#promo-toggle {
  background: none; border: none; cursor: pointer;
  font-family: var(--sans); font-size: .8rem; color: #7A6E5F;
  text-align: left; padding: 2px 0;
  text-decoration: underline; text-decoration-color: transparent;
  transition: color .2s;
}
#promo-toggle:hover { color: #B8941F; text-decoration-color: #B8941F; }
#promo-field { display: flex; gap: 8px; }
.promo-apply {
  background: #1C1710; color: #FAF8F4; border: none; border-radius: 50px;
  font-family: var(--sans); font-size: .72rem; font-weight: 600;
  padding: 0 18px; cursor: pointer; transition: background .2s; white-space: nowrap;
}
.promo-apply:hover { background: #B8941F; }
.modal-total-block { display: flex; flex-direction: column; gap: 0; margin-bottom: 18px; }
.modal-total-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-bottom: 1px solid #EDE8E0;
  font-family: var(--sans); font-size: .86rem; color: #3A3228;
}
.modal-total-line span:first-child { font-weight: 500; }
.modal-total-line span:last-child  { font-weight: 400; color: #5A5048; }
.modal-total-line.grand            { border-bottom: none; padding-top: 13px; margin-top: 3px; }
.modal-total-line.grand span       { font-size: 1rem; font-weight: 700; color: #1C1710; }
#submit-btn {
  width: 100%; background: #1C2D5E; color: #fff; border: none;
  border-radius: 50px; font-family: var(--sans); font-size: .9rem;
  font-weight: 600; padding: 16px 32px; cursor: pointer;
  transition: background .25s;
}
#submit-btn:hover:not(:disabled) { background: #243870; }
#submit-btn:disabled              { cursor: not-allowed; opacity: .85; }

/* ── ALERTS (panier) ─────────────────────────────────────── */
.alert { padding: 12px 18px; border-radius: 6px; font-size: .88rem; margin-bottom: 16px; }
.alert-danger  { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }

/* ── RESPONSIVE PARTAGÉ ──────────────────────────────────── */
@media (max-width: 960px) {
  nav           { padding: 14px 20px; top: 34px; }
  nav.scrolled  { padding: 12px 20px; top: 0; }
  .nav-links    { display: none; }
  .nav-right .nav-icon-btn:first-child { display: none; }
  footer        { padding: 40px 20px 24px; }
  .footer-top   { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
  .sticky-buy   { display: flex; }
}
@media (max-width: 480px) {
  .modal-row   { grid-template-columns: 1fr; }
  .modal-body  { padding: 14px 16px 20px; }
}
