/* ===== Variables : modifiez ici les couleurs et la typographie ===== */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #5e6b7a;
  --border: #dde3ea;
  --accent: #2b5f8f;
  --accent-dark: #204a70;
  --accent-soft: #e3edf7;
  --danger: #b8402e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(27, 36, 48, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
input { font: inherit; }
h1, h2, h3 { font-weight: 700; }
.container { width: min(1120px, 100% - 2rem); margin-inline: auto; }

/* ===== En-tête ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 247, 250, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; }
.brand__mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: inline-grid; place-items: center; color: #fff; font-size: 0.9rem; }
.nav { display: flex; gap: 1.25rem; align-items: center; }
.nav a { text-decoration: none; font-weight: 500; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.cart-link { display: inline-flex; align-items: center; gap: 0.4rem; }
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge[hidden] { display: none; }

/* ===== Accueil ===== */
.hero { padding: 3.5rem 0 2rem; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; margin: 0 0 0.75rem; letter-spacing: -0.02em; }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 42rem; margin: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  color: var(--muted);
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.5rem;
  padding-bottom: 4rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__image { aspect-ratio: 1; background: #eaeff5; overflow: hidden; }
.card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.card:hover .card__image img { transform: scale(1.04); }
.card__body { padding: 1rem 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.card__category { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 700; }
.card__title { margin: 0; font-size: 1.05rem; }
.card__title a { text-decoration: none; }
.card__desc { margin: 0; color: var(--muted); font-size: 0.92rem; }
.card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 0.75rem; gap: 0.5rem; }
.price { font-weight: 700; font-size: 1.1rem; }
.price--lg { font-size: 1.6rem; margin: 0 0 1rem; }

/* ===== Boutons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--surface); }
.btn--lg { padding: 0.85rem 1.5rem; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ===== Fiche produit ===== */
.product { display: grid; grid-template-columns: 1fr; gap: 2rem; padding: 2rem 0 4rem; }
@media (min-width: 820px) {
  .product { grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: start; }
}
.gallery__main { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: #eaeff5; border: 1px solid var(--border); }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 0.6rem; margin-top: 0.75rem; }
.gallery__thumb { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #eaeff5; aspect-ratio: 1; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb:hover { border-color: var(--border); }
.gallery__thumb.is-active { border-color: var(--accent); }
.back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 1rem; font-size: 0.95rem; }
.back:hover { color: var(--text); }
.product-info h1 { margin: 0.25rem 0 0.5rem; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; letter-spacing: -0.01em; }
.product-info__desc { color: var(--muted); font-size: 1.02rem; }
.stock { font-size: 0.9rem; font-weight: 600; }
.stock.in { color: var(--accent); }
.stock.out { color: var(--danger); }
.add-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

.qty { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.qty button { width: 2.6rem; border: 0; background: transparent; font-size: 1.1rem; color: var(--text); }
.qty button:hover { background: var(--accent-soft); }
.qty input { width: 3.2rem; text-align: center; border: 0; border-inline: 1px solid var(--border); -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ===== Panier ===== */
.page-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 2rem 0 1.25rem; letter-spacing: -0.01em; }
.cart-layout { display: grid; gap: 2rem; padding-bottom: 4rem; }
@media (min-width: 900px) {
  .cart-layout { grid-template-columns: 1fr 340px; align-items: start; }
}
.cart-list { display: flex; flex-direction: column; gap: 1rem; }
.cart-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
}
.cart-item__img { width: 88px; height: 88px; border-radius: 10px; overflow: hidden; background: #eaeff5; }
.cart-item__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__name { margin: 0 0 0.2rem; font-size: 1rem; }
.cart-item__name a { text-decoration: none; }
.cart-item__unit { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.5rem; }
.cart-item__right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }
.link-danger { background: none; border: 0; color: var(--danger); font-size: 0.85rem; padding: 0; text-decoration: underline; }
.summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; position: sticky; top: 84px; }
.summary h2 { margin: 0 0 1rem; font-size: 1.15rem; }
.summary__row { display: flex; justify-content: space-between; padding: 0.35rem 0; color: var(--muted); }
.summary__row--total { border-top: 1px solid var(--border); margin-top: 0.5rem; padding-top: 0.9rem; color: var(--text); font-weight: 700; font-size: 1.2rem; }
.summary .btn { margin-top: 1rem; }
.summary__note { font-size: 0.8rem; color: var(--muted); margin: 0.75rem 0 0; text-align: center; }
.notice { background: #fff6dc; border: 1px solid #f0dc9a; color: #6b5313; border-radius: 10px; padding: 0.75rem 1rem; font-size: 0.92rem; margin-bottom: 1.25rem; }
.empty { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty .btn { margin-top: 1rem; }

/* ===== Pages de confirmation / annulation ===== */
.status {
  max-width: 560px;
  margin: 4rem auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
}
.status__icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; font-size: 1.8rem; background: var(--accent-soft); color: var(--accent); }
.status__icon--warn { background: #fdeae6; color: var(--danger); }
.status h1 { margin: 0 0 0.5rem; font-size: 1.7rem; }
.status p { color: var(--muted); }
.status .notice { text-align: left; }
.status .btn { margin: 0.5rem 0.25rem 0; }
.order-lines { list-style: none; padding: 0; margin: 1.5rem 0; text-align: left; border-top: 1px solid var(--border); }
.order-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.order-lines li.total { font-weight: 700; }

/* ===== Pied de page ===== */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; color: var(--muted); font-size: 0.9rem; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer a { color: var(--muted); }

/* ===== Notification ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 20px);
  background: var(--text);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
  font-size: 0.95rem;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: #fff; font-weight: 600; margin-left: 0.5rem; }

/* ===== Mobile ===== */
@media (max-width: 520px) {
  .cart-item { grid-template-columns: 72px 1fr; }
  .cart-item__img { width: 72px; height: 72px; }
  .cart-item__right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .summary { position: static; }
}
