/* ==========================================================
   Bernadette Création — feuille de style
   Rouge de la carte de visite + fond crème, responsive
   ========================================================== */

@font-face { font-family: "Great Vibes"; src: url("../fonts/great-vibes-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/montserrat-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/montserrat-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/montserrat-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --red: #b4231f;          /* rouge de la carte */
  --red-dark: #8e1a17;
  --red-text: #7a1d19;     /* même teinte, plus foncée pour le texte courant (lisibilité) */
  --red-soft: #f6e1dc;
  --cream: #fbf6ec;        /* fond crème */
  --cream-2: #f3eadb;
  --paper: #fffdf8;
  --line: #e7d6c6;
  --muted: #9a5a52;
  --ok: #2f6b3a;  --ok-bg: #e4f1e3;
  --warn: #8a5a00; --warn-bg: #fbefd2;
  --info: #2c4f78; --info-bg: #e3ecf6;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(122, 29, 25, .08);
  --script: "Great Vibes", "Brush Script MT", cursive;
  --sans: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--red-text);
  font: 400 1rem/1.6 var(--sans); min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }
h1, h2, h3 { color: var(--red); line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code { background: var(--cream-2); padding: .1em .35em; border-radius: 4px; }
.brand-script { font-family: var(--script); font-weight: 400; font-size: clamp(2.2rem, 6vw, 3.2rem); color: var(--red); }
.container { width: min(1180px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(720px, 100% - 2rem); margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--muted); font-size: .92em; }
.section { padding: 2.2rem 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--red); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid #e2a23b; outline-offset: 2px; }

/* ---------- En-tête ---------- */
.topbar { background: var(--red); color: #fff; font-size: .85rem; }
.topbar .container { display: flex; gap: 1.2rem; justify-content: flex-end; flex-wrap: wrap; padding: .35rem 0; }
.topbar a { color: #fff; text-decoration: none; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 1rem; padding: .5rem 0; }
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; margin-right: auto; }
.logo img { width: 74px; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-text .script { font-family: var(--script); font-size: 2.1rem; color: var(--red); }
.logo-text .caps { letter-spacing: .32em; font-size: .7rem; color: var(--red); padding-left: .3em; }

.nav-toggle { display: none; background: none; border: 2px solid var(--red); color: var(--red); border-radius: 8px; padding: .4rem .7rem; font: 600 .95rem var(--sans); cursor: pointer; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > ul { display: flex; align-items: center; gap: .2rem; }
.main-nav a, .main-nav .dropdown-btn {
  display: block; padding: .55rem .85rem; border-radius: 8px; text-decoration: none; color: var(--red-text);
  font: 600 .95rem var(--sans); background: none; border: 0; cursor: pointer;
}
.main-nav a:hover, .main-nav .dropdown-btn:hover, .main-nav a[aria-current="page"] { background: var(--red-soft); color: var(--red); }
.has-dropdown { position: relative; }
.dropdown-btn::after { content: ""; display: inline-block; margin-left: .4rem; border: 5px solid transparent; border-top-color: currentColor; vertical-align: -2px; }
.dropdown { display: none; position: absolute; top: 100%; left: 0; min-width: 230px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: .35rem; z-index: 60; }
.has-dropdown.open > .dropdown { display: block; }
@media (hover: hover) and (min-width: 901px) { .has-dropdown:hover > .dropdown, .has-dropdown:focus-within > .dropdown { display: block; } }
.cart-link { position: relative; }
.cart-count { display: inline-block; min-width: 1.4em; padding: 0 .35em; margin-left: .25rem; background: var(--red); color: #fff; border-radius: 1em; font-size: .78rem; text-align: center; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .main-nav.open { display: block; }
  .main-nav > ul { flex-direction: column; align-items: stretch; padding: .5rem 1rem 1rem; }
  .dropdown { position: static; box-shadow: none; border: 0; padding-left: 1rem; }
  .logo img { width: 58px; }
  .logo-text .script { font-size: 1.7rem; }
}

/* ---------- Boutons & formulaires ---------- */
.btn {
  display: inline-block; background: var(--red); color: #fff; border: 2px solid var(--red); border-radius: 999px;
  padding: .7rem 1.4rem; font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; text-align: center; line-height: 1.2;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--red); }
.btn-outline:hover { background: var(--red-soft); color: var(--red-dark); }
.btn-small { padding: .4rem .9rem; font-size: .88rem; }
.btn-block { display: block; width: 100%; }
.btn-ghost { background: none; border: 0; color: var(--red); text-decoration: underline; cursor: pointer; font: inherit; padding: .2rem; }
.btn-danger { background: #fff; color: #a01010; border-color: #d9a3a3; }
.btn-danger:hover { background: #a01010; border-color: #a01010; color: #fff; }
.btn-ok { background: var(--ok); border-color: var(--ok); }
.btn-ok:hover { background: #224f2a; border-color: #224f2a; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: .3rem; font-weight: 600; font-size: .95rem; }
.form .hint { font-weight: 400; font-size: .85rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: .7rem .8rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  font: 400 1rem var(--sans); color: #4a1512;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); outline: none; box-shadow: 0 0 0 3px rgba(180, 35, 31, .15); }
textarea { min-height: 140px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 1rem; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.check { display: flex !important; grid-template-columns: none; align-items: flex-start; gap: .6rem !important; font-weight: 400 !important; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; accent-color: var(--red); flex: none; }
.hp-field { position: absolute; left: -5000px; } /* piège anti-robots */

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1.2rem; }

/* ---------- Alertes & badges ---------- */
.alert { padding: .9rem 1.1rem; border-radius: 10px; margin: 0 0 1rem; border-left: 5px solid; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.alert-error { background: #fbe3e1; color: #8e1212; border-color: #b4231f; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: var(--info); }
.flash-zone { margin-top: 1rem; }
.badge { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.st-wait { background: var(--warn-bg); color: var(--warn); }
.st-paid { background: var(--info-bg); color: var(--info); }
.st-sent { background: #efe3f6; color: #5b2c78; }
.st-done { background: var(--ok-bg); color: var(--ok); }
.st-cancel { background: #eee; color: #666; }

/* ---------- Accueil ---------- */
.hero { background: linear-gradient(180deg, var(--paper), var(--cream)); border-bottom: 1px solid var(--line); }
.hero .container { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: center; padding: 2.5rem 0; }
.hero img { width: min(340px, 100%); margin-inline: auto; }
.hero p { font-size: 1.08rem; }
@media (max-width: 760px) { .hero .container { grid-template-columns: 1fr; text-align: center; } .hero img { width: 210px; order: -1; } }
.services { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.5rem; padding: 0; list-style: none; }
.hero .services { }
@media (max-width: 760px) { .services { justify-content: center; } }
.services li { background: var(--red-soft); color: var(--red); border-radius: 999px; padding: .3rem .8rem; font-size: .88rem; font-weight: 600; }
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.cat-tile { display: block; padding: 1.3rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; text-align: center; font-weight: 700; box-shadow: var(--shadow); }
.cat-tile:hover { border-color: var(--red); transform: translateY(-2px); }
.cat-tile .script { display: block; font-family: var(--script); font-weight: 400; font-size: 2rem; }

/* ---------- Grille d'articles ---------- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.3rem; }
@media (max-width: 520px) { .products { grid-template-columns: 1fr 1fr; gap: .8rem; } }
.product-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.product-card a.thumb { display: block; aspect-ratio: 1; overflow: hidden; background: var(--cream-2); }
.product-card a.thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform .3s; }
.product-card:hover a.thumb img { transform: scale(1.04); }
.product-card .body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.product-card h3 { margin: 0; font-size: 1rem; }
.product-card h3 a { text-decoration: none; color: var(--red-text); }
.price { font-weight: 700; color: var(--red); font-size: 1.1rem; }
.product-card .price { margin-top: auto; }
.soldout { color: #777; font-weight: 600; font-size: .9rem; }
.breadcrumb { font-size: .88rem; margin: 1rem 0; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

/* ---------- Fiche article ---------- */
.product-page { display: grid; grid-template-columns: 1fr 1fr; gap: 2.2rem; align-items: start; }
@media (max-width: 800px) { .product-page { grid-template-columns: 1fr; } }
.gallery-main { border-radius: var(--radius); overflow: hidden; background: var(--cream-2); aspect-ratio: 1; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; transition: transform .2s ease-out; }
@media (hover: hover) and (pointer: fine) { .gallery-main { cursor: zoom-in; } }
.gallery-main.zoomed img { transition: transform .2s ease-out, transform-origin .05s linear; }
@media (prefers-reduced-motion: reduce) { .gallery-main img, .gallery-main.zoomed img { transition: none; } }
.gallery-thumbs { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.gallery-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; width: 72px; height: 72px; cursor: pointer; background: none; }
.gallery-thumbs button.active { border-color: var(--red); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-info .price { font-size: 1.6rem; margin-bottom: 1rem; }
.qty-row { display: flex; gap: .8rem; align-items: end; flex-wrap: wrap; margin: 1.2rem 0; }
.qty-row label { font-weight: 600; display: grid; gap: .3rem; }
.qty-row input { width: 90px; }

/* ---------- Panier / commande ---------- */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: .8rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.cart-table th { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cart-table .num { text-align: right; white-space: nowrap; }
.cart-item { display: flex; align-items: center; gap: .8rem; }
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.cart-table input[type=number] { width: 80px; }
@media (max-width: 640px) {
  .cart-table thead { display: none; }
  .cart-table tr { display: grid; grid-template-columns: 1fr auto; gap: .3rem .8rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .cart-table td { border: 0; padding: 0; }
  .cart-table td:first-child { grid-column: 1 / -1; }
  .cart-table td[data-label]::before { content: attr(data-label) " : "; font-size: .85rem; color: var(--muted); }
}
.totals { margin-left: auto; width: min(380px, 100%); }
.totals dl { display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; margin: 0 0 1rem; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; font-weight: 600; }
.totals .grand { font-size: 1.25rem; color: var(--red); font-weight: 700; border-top: 2px solid var(--line); padding-top: .5rem; }
.checkout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .checkout { grid-template-columns: 1fr; } }
.choice { display: flex; gap: .8rem; align-items: flex-start; border: 2px solid var(--line); border-radius: var(--radius); padding: 1rem; cursor: pointer; background: #fff; }
.choice + .choice { margin-top: .7rem; }
.choice input { width: 1.3rem; height: 1.3rem; accent-color: var(--red); margin-top: .2rem; flex: none; }
.choice:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.choice strong { display: block; }
.is-hidden { display: none !important; }
.rib { background: #fff; border: 2px dashed var(--red); border-radius: var(--radius); padding: 1.2rem; }
.rib dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0; }
.rib dt { color: var(--muted); }
.rib dd { margin: 0; font-weight: 700; word-break: break-all; font-family: ui-monospace, Consolas, monospace; font-size: 1.02rem; color: #4a1512; }
.rib .ref { color: var(--red); font-size: 1.2rem; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; padding-left: 2.4rem; position: relative; margin-bottom: .7rem; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }

/* ---------- Tableaux génériques ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--paper); }
.table th, .table td { padding: .7rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { background: var(--cream-2); font-size: .85rem; }
.table tr.unread td { font-weight: 700; }
.table img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; }
.table .num { text-align: right; white-space: nowrap; }

/* ---------- Pied de page (comme le verso de la carte) ---------- */
.site-footer { background: var(--red); color: #fff; margin-top: 3rem; }
.site-footer .container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; padding: 2.2rem 0 1.5rem; }
.site-footer a { color: #fff; }
.site-footer h2 { color: #fff; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .08em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.site-footer .script { font-family: var(--script); font-size: 2.4rem; line-height: 1; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .25); text-align: center; font-size: .82rem; padding: .9rem 1rem; }
@media (max-width: 760px) { .site-footer .container { grid-template-columns: 1fr; text-align: center; } }

/* ---------- Compte client ---------- */
.account-grid { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: start; }
.account-nav { display: grid; gap: .3rem; }
.account-nav a { display: block; padding: .6rem .9rem; border-radius: 8px; text-decoration: none; font-weight: 600; }
.account-nav a.active, .account-nav a:hover { background: var(--red-soft); }
@media (max-width: 760px) { .account-grid { grid-template-columns: 1fr; } .account-nav { grid-auto-flow: column; overflow-x: auto; } }
.auth-box { width: min(480px, 100% - 2rem); margin: 2rem auto; }

/* ==========================================================
   Administration
   ========================================================== */
.admin-body { background: #f8f2e8; }
.admin-header { background: var(--red); color: #fff; }
.admin-header .container { display: flex; align-items: center; gap: 1rem; padding: .6rem 0; flex-wrap: wrap; }
.admin-header .brand { font-family: var(--script); font-size: 2rem; color: #fff; text-decoration: none; margin-right: auto; }
.admin-header a { color: #fff; }
.admin-nav { background: var(--paper); border-bottom: 1px solid var(--line); }
.admin-nav ul { list-style: none; display: flex; gap: .3rem; margin: 0; padding: .4rem 0; overflow-x: auto; }
.admin-nav a { display: block; padding: .6rem 1rem; text-decoration: none; font-weight: 600; border-radius: 8px; white-space: nowrap; }
.admin-nav a.active, .admin-nav a:hover { background: var(--red-soft); }
.admin-main { padding: 1.6rem 0 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head h1 { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.tile { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; text-decoration: none; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--red); }
.tile .n { font-size: 2.2rem; font-weight: 700; color: var(--red); display: block; line-height: 1.1; }
.tile.alert-tile { border: 2px solid var(--red); background: var(--red-soft); }
.help { background: var(--info-bg); color: var(--info); border-radius: 10px; padding: .8rem 1rem; font-size: .92rem; margin-bottom: 1rem; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; background: var(--paper); margin: 0 0 1.4rem; }
.fieldset legend { font-weight: 700; color: var(--red); padding: 0 .5rem; font-size: 1.05rem; }
.img-manager { display: flex; flex-wrap: wrap; gap: .8rem; }
.img-manager figure { margin: 0; width: 130px; text-align: center; }
.img-manager img { width: 130px; height: 130px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.img-manager figcaption { font-size: .8rem; margin-top: .3rem; }
.inline-form { display: inline; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters a { padding: .4rem .9rem; border: 1.5px solid var(--line); border-radius: 999px; text-decoration: none; font-size: .9rem; background: var(--paper); }
.filters a.active { background: var(--red); border-color: var(--red); color: #fff; }
.order-actions form { margin-bottom: .6rem; }
.admin-login { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.login-box { width: min(440px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.login-box img { width: 140px; margin: 0 auto 1rem; }
.status-pill-form select { width: auto; }
@media (max-width: 640px) { .table.responsive thead { display: none; } .table.responsive tr { display: block; border-bottom: 2px solid var(--line); padding: .5rem 0; } .table.responsive td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .35rem .5rem; } .table.responsive td[data-label]::before { content: attr(data-label); font-weight: 600; color: var(--muted); } }
.steps { text-align: left; }
.hero .brand-script { font-size: clamp(2.2rem, 6vw, 3.2rem); margin: 0; line-height: 1.1; }
.admin-header .btn-outline { color: #fff; border-color: #fff; } .admin-header .btn-outline:hover { background: #fff; color: var(--red); }
@media (max-width: 760px) {
  .topbar .container { justify-content: center; gap: .3rem 1rem; }
  .hero .brand-script { display: none; }
  .btn-row { justify-content: center; }
}
