/* ===============================
   style.css — v6 (propre & vérifié)
================================== */

/* — Variables — */
:root {
  --main-bg: #fdf6f0;
  --text-main: #333;
  --text-muted: #666;

  --accent-rose: #f4b6c2;
  --accent-rose-hover: #f28ca3;
  --accent-green: #b3d9c6;
  --accent-lav: #c7b7e0;
  --accent-blue: #a0b9dc;

  --header-bg-light: #b4c8eb;
  --header-bg-dark: #a0b9dc;

  --btn-radius: 8px;
  --container-w: 1200px;

  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* — Reset simple — */
* { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

/* — Corps — */
body {
  background: var(--main-bg);
  color: var(--text-main);
  font-family: var(--font);
  line-height: 1.6;
}

/* — Conteneur — */
.container { width: 90%; max-width: var(--container-w); margin: 0 auto; }

/* ===============================
   Header
================================== */
.site-header{
  position: sticky; top: 0; z-index: 1000;
  backdrop-filter: saturate(140%) blur(8px);
  background: linear-gradient(180deg, rgba(180,200,235,.95) 0%, rgba(160,185,220,.92) 100%);
  border-bottom: 1px solid #d3d9e8;
  transition: box-shadow .25s ease;
}
.site-header.scrolled { box-shadow: 0 8px 24px rgba(0,0,0,.08); }

.site-header .inner{
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1rem;
}

.brand{ display: flex; align-items: center; gap: 1rem; text-decoration: none; }
.brand .logo{
  width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(135deg, var(--header-bg-light), var(--header-bg-dark));
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px #d3d9e8;
  font-weight: 800; color: #fff; font-size: 1.05rem; letter-spacing: .5px;
}
.brand .titles{ display: flex; flex-direction: column; line-height: 1.1; }
.brand .title{ font-weight: 800; font-size: 1.55rem; color: var(--text-main); }
.brand .tagline{ font-size: 1rem; color: var(--text-muted); }

.nav{ display: flex; align-items: center; gap: 1rem; }
.nav-menu{ display: flex; align-items: center; gap: .75rem; }
.nav-menu a{
  position: relative; text-decoration: none; color: var(--text-main);
  padding: .35rem .6rem; border-radius: 8px; font-weight: 600;
}
.nav-menu a.active::after,
.nav-menu a:hover::after{
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 4px; height: 3px;
  background: var(--accent-rose); border-radius: 999px; opacity: .8;
}
.nav-toggle{ display: none; background: #fff; border: 1px solid #f3e4ea; border-radius: 10px; padding: .5rem .6rem; }

/* ===============================
   Toolbar (recherche / filtres / tri)
================================== */
.toolbar {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin: 1rem 0 2rem;
}
.toolbar input,
.toolbar select {
  padding: .45rem .6rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}

/* ===============================
   Grille produits & cartes
================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
  gap: 1.2rem;
  margin: 1.5rem 0 2.5rem;
}

.product-card{
  background: #fff;
  border: 1px solid var(--accent-lav);
  border-radius: 16px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
  cursor: pointer;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }

.product-card .card-wrap { position: relative; }
.product-card img{ width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }

.badge{
  position: absolute; top: 10px; left: 10px;
  background: var(--accent-green); color: var(--text-main);
  padding: .25rem .5rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600;
}
.badge.out{ background: #ddd; }

.p-body{ padding: 1rem; display: flex; flex-direction: column; gap: .45rem; }
.p-title{ font-weight: 800; font-size: 1.1rem; }
.p-sub{ font-size: .9rem; color: var(--text-muted); }
.p-bottom{ margin-top: .2rem; display: flex; align-items: center; justify-content: space-between; }
.price{ font-weight: 800; color: var(--text-main); }

.btn{
  background: var(--accent-rose); color: #fff;
  border: 0; border-radius: var(--btn-radius); padding: .45rem .85rem;
  cursor: pointer; transition: background .25s ease;
}
.btn:hover{ background: var(--accent-rose-hover); }
.btn[disabled]{ opacity: .6; cursor: not-allowed; }

.chip{
  display: inline-block;
  background: var(--accent-lav);
  color: #fff; font-size: .75rem;
  padding: .15rem .5rem; border-radius: 999px; margin: .2rem .25rem 0 0;
}

/* ===============================
   Modales (panier + fiche produit)
================================== */
.modal{
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  align-items: center; justify-content: center;
  padding: 1rem; z-index: 2000;
}
.modal-content{
  background: #fff; border-radius: 16px;
  padding: 1.5rem; max-width: 760px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  border: 2px solid var(--accent-lav);
  position: relative;
}
.modal .close{ position: absolute; right: 14px; top: 10px; font-size: 1.4rem; cursor: pointer; }

/* — Panier — */
.cart-line{ display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid #eee; }
.cart-controls{ display: flex; align-items: center; gap: .3rem; }
.btn-qty{ background: var(--accent-rose); color: #fff; border: none; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; }
.btn-qty:hover{ background: var(--accent-green); color: var(--text-main); }
.qty{ min-width: 24px; text-align: center; }
.remove{ background: none; border: none; cursor: pointer; font-size: 1rem; }

/* — Fiche produit / galerie — */
.pm-grid{ display: grid; grid-template-columns: 1.1fr .9fr; }
@media (max-width: 900px){ .pm-grid{ grid-template-columns: 1fr; } }

.pm-left{ background: #fff; padding: 1rem; position: relative; }
.pm-right{ background: #fffaf7; border-left: 1px solid #f3e4ea; padding: 1.25rem; }

.pm-title{ font-size: 1.25rem; font-weight: 800; margin-bottom: .25rem; }
.pm-sub{ color: #555; margin-bottom: .5rem; }
.pm-tags{ margin: .5rem 0 1rem; }
.pm-actions{ display: flex; gap: .5rem; align-items: center; }

.pm-nav{
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 100%; display: flex; justify-content: space-between;
  pointer-events: none; padding: 0 6px;
}
.pm-nav button{
  pointer-events: auto; background: rgba(255,255,255,.9);
  border: 1px solid #ead8de; border-radius: 999px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

.pm-main{
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--accent-lav);
}
.pm-thumbs{ display: flex; gap: .5rem; margin-top: .6rem; overflow-x: auto; }
.pm-thumb{
  width: 80px; height: 60px; object-fit: cover;
  border-radius: 8px; border: 2px solid transparent; cursor: pointer; flex: 0 0 auto;
}
.pm-thumb.active{ border-color: var(--accent-rose); }

/* ===============================
   Bouton panier flottant
================================== */
.floating-cart{
  position: fixed; bottom: 20px; right: 20px;
  background: linear-gradient(135deg, var(--accent-rose), var(--accent-blue));
  color: #fff; border-radius: 50%;
  width: 54px; height: 54px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.2);
  cursor: pointer; font-size: 1.4rem; z-index: 1500;
}
.floating-cart .badge{
  position: absolute; top: 4px; right: 4px;
  background: #fff; color: var(--text-main);
  border: 2px solid var(--accent-lav);
  font-size: .75rem; font-weight: 700; padding: 0 .3rem;
}

/* — Animation image → panier — */
.flying-img{
  position: fixed; pointer-events: none;
  transition: transform .7s ease, opacity .7s ease;
  z-index: 5000; border-radius: 8px;
}

/* ===============================
   Footer
================================== */
footer{
  background: #fcecf2; text-align: center;
  padding: 1rem; font-size: .9rem; margin-top: 2rem; color: #555;
}

/* ===============================
   Messages debug (catalog)
================================== */
.catalog-error{
  margin: 1rem 0; padding: .8rem 1rem;
  border: 1px solid #e6b8be; background: #fff0f3;
  border-radius: 10px; color: #842029;
}
.catalog-status{ margin: .5rem 0; color: #5c5c5c; font-size: .9rem; }

/* ===============================
   Responsive nav
================================== */
@media (max-width: 820px){
  .nav-menu{
    display: none; position: absolute; left: 0; right: 0; top: 56px;
    margin: 0 auto; max-width: var(--container-w);
    padding: .6rem .9rem; background: #fff; border-bottom: 1px solid #f3e4ea;
  }
  .nav-menu.open{ display: flex; flex-direction: column; align-items: center; gap: .75rem; }
  .nav-toggle{ display: inline-flex; }
}

/* ===============================
   Thème sombre (optionnel)
   Active en ajoutant <body class="dark-mode">
================================== */
body.dark-mode { background: #1c1e26; color: #f5f5f5; }
body.dark-mode .site-header{
  background: linear-gradient(180deg, rgba(30,40,60,.95) 0%, rgba(20,25,40,.92) 100%);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
body.dark-mode .brand .logo{ background: linear-gradient(135deg, #2f3a55, #1e2740); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
body.dark-mode .brand .title{ color: #fff; }
body.dark-mode .brand .tagline{ color: #aaa; }
body.dark-mode .nav-menu a{ color: #f5f5f5; }
body.dark-mode .product-card{ background: #2a2d3a; border: 1px solid rgba(255,255,255,.1); }
body.dark-mode .p-sub{ color: #bbb; }
body.dark-mode .chip{ background: var(--accent-blue); color: #fff; }
body.dark-mode .modal-content{ background: #2a2d3a; color: #fff; border: 2px solid var(--accent-blue); }
body.dark-mode .cart-line{ border-bottom: 1px solid rgba(255,255,255,.1); }
body.dark-mode .floating-cart{ background: linear-gradient(135deg, var(--accent-rose), var(--accent-blue)); }
body.dark-mode footer{ background: #2a2d3a; color: #bbb; }
