/* ==========================================================================
   Site public — les couleurs / polices / arrondis viennent des variables CSS
   injectées par l'administration (voir layout.ejs).
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-body); color: var(--text); background: var(--bg);
  line-height: 1.6; font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.1rem; color: var(--muted); }
.req { color: #c0392b; }
.pre-wrap { white-space: pre-wrap; }
[hidden] { display: none !important; }
.container { width: min(1180px, 100% - 2rem); margin-inline: auto; }
.container.narrow { max-width: 760px; }
.block { padding: clamp(2rem, 5vw, 4rem) 0; }
.block-title { text-align: center; margin-bottom: 2rem; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.block-head .block-title { margin: 0; text-align: left; }
.link-more { font-weight: 600; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.4rem; border-radius: var(--btn-radius); border: 2px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; transition: transform .15s, box-shadow .15s, background .15s;
  line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-light { background: #fff; color: var(--primary); }
.btn-lg { padding: .9rem 1.8rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-google { background: #fff; color: #333; border-color: #ddd; }
.btn[disabled] { opacity: .6; cursor: default; transform: none; box-shadow: none; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; }
.inline-form { display: inline; }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .95rem; }
.field .help { color: var(--muted); font-size: .8rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid #d9d2d4; border-radius: calc(var(--radius) / 1.6); background: var(--surface);
  font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
textarea { resize: vertical; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.checkbox input { width: 1.1rem; height: 1.1rem; accent-color: var(--primary); }
.stack { display: flex; flex-direction: column; gap: .5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.color-field { display: flex; align-items: center; gap: .75rem; }
.color-field input[type="color"] { width: 48px; height: 36px; border: 1px solid #ddd; border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
/* Palette de couleurs (options de personnalisation) */
.swatches { display: flex; flex-wrap: wrap; gap: .6rem .9rem; }
.swatch-item { display: flex; flex-direction: column; align-items: center; gap: .25rem; cursor: pointer; width: 64px; text-align: center; }
.swatch-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.swatch-item .swatch { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #cfc6c9, 0 2px 6px rgba(0,0,0,.12); transition: transform .15s, box-shadow .15s; }
.swatch-item small { font-size: .72rem; color: var(--muted); line-height: 1.15; }
.swatch-item .swatch-none { background: repeating-linear-gradient(45deg, #f3f3f3 0 6px, #e4e4e4 6px 12px) !important; }
.swatch-item:hover .swatch { transform: scale(1.08); }
.swatch-item input:checked + .swatch { box-shadow: 0 0 0 3px var(--primary), 0 2px 6px rgba(0,0,0,.15); transform: scale(1.08); }
.swatch-item input:checked ~ small { color: var(--text); font-weight: 700; }
.swatch-item input:focus-visible + .swatch { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt-dependent { margin-left: 1.6rem; padding-left: .9rem; border-left: 3px solid var(--secondary); }
.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); vertical-align: middle; margin-right: .3rem; }
/* Code promo */
.promo-box { margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed #e3dcde; }
.promo-box label { display: block; margin-bottom: .35rem; font-weight: 600; }
.promo-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.promo-row input { flex: 1; min-width: 120px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.promo-row .btn { padding: .55rem .9rem; margin-top: 0 !important; }
.promo-msg { margin-top: .5rem; padding: .45rem .7rem; border-radius: calc(var(--radius) / 2); }
.promo-msg.ok { background: #e3f6e8; color: #20773a; }
.promo-msg.err { background: #fdecea; color: #a12b1f; }
.summary-row.discount { color: #20773a; font-weight: 600; }
.order-table .discount td { color: #20773a; }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; }

/* Messages */
.flash { padding: .8rem 1rem; border-radius: calc(var(--radius) / 1.5); margin: 1rem 0; border: 1px solid transparent; }
.flash-success { background: #e7f6ec; color: #1d6b38; border-color: #bfe6cc; }
.flash-error { background: #fdecea; color: #a12b1f; border-color: #f5c6c1; }
.flash-info { background: #eaf2fd; color: #1c4e8a; border-color: #c6dbf5; }
.notice { background: var(--secondary); padding: .8rem 1rem; border-radius: calc(var(--radius) / 1.5); margin-bottom: 1rem; }
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: .8rem 1.2rem; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 1000; font-weight: 600; max-width: calc(100% - 2rem); }
.toast a { color: #fff; text-decoration: underline; margin-left: .5rem; }

/* Bandeau */
.announcement { background: var(--primary); color: #fff; text-align: center; padding: .45rem 1rem; font-size: .9rem; font-weight: 600; }

/* En-tête */
.site-header { background: var(--surface); border-bottom: 1px solid rgba(0,0,0,.06); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 70px; }
.brand { display: flex; align-items: center; }
.brand-logo { max-height: 48px; width: auto; }
.brand-name { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; color: var(--text); }
.main-nav { display: flex; gap: 1.25rem; align-items: center; flex: 1; }
.main-nav a { color: var(--text); font-weight: 600; padding: .3rem 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { text-decoration: none; border-bottom-color: var(--primary); color: var(--primary); }
.nav-dropdown { position: relative; }
.nav-dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: var(--surface); box-shadow: 0 10px 30px rgba(0,0,0,.12); border-radius: calc(var(--radius) / 1.5); padding: .5rem 0; min-width: 180px; }
.nav-dropdown-menu a { display: block; padding: .5rem 1rem; border: 0; }
/* Survol et focus : uniquement sur ordinateur. Au doigt, un survol "colle"
   apres le toucher et empechait de refermer le menu. */
@media (min-width: 761px) {
  .nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
}
.header-actions { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.header-search input { width: 170px; padding: .45rem .8rem; border-radius: 999px; }
.icon-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--text); position: relative; font-weight: 600; font-size: .9rem; }
.icon-link:hover { color: var(--primary); text-decoration: none; }
.cart-count { position: absolute; top: -6px; right: -8px; background: var(--primary); color: #fff; font-size: .7rem; min-width: 18px; height: 18px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.burger { display: none; background: none; border: 0; width: 40px; height: 40px; padding: 8px; cursor: pointer; flex-direction: column; justify-content: space-around; }
.burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
.header-centered .header-inner { flex-wrap: wrap; justify-content: center; }
.header-centered .brand { width: 100%; justify-content: center; padding-top: .75rem; }
.header-centered .main-nav { justify-content: center; flex: 0 1 auto; }
.header-centered .header-actions { margin-left: 0; }
.header-minimal .header-search { display: none; }
.header-minimal .icon-label { display: none; }

/* Hero */
.block-hero { background: var(--secondary); padding: clamp(3rem, 8vw, 6rem) 0; position: relative; overflow: hidden; }
.block-hero.has-image { background-size: cover; background-position: center; color: #fff; }
.block-hero.has-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.15)); }
.block-hero.has-image.align-center::before { background: rgba(0,0,0,.4); }
.hero-inner { position: relative; }
.hero-content { max-width: 620px; }
.block-hero.align-center .hero-content { margin-inline: auto; text-align: center; }
.block-hero.align-right .hero-content { margin-left: auto; }
.block-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: .6rem; }
.hero-subtitle { font-size: 1.15rem; margin-bottom: 1.5rem; opacity: .9; }
.block-hero .btn { margin: .25rem .5rem .25rem 0; }
.block-hero.has-image .btn-outline { color: #fff; border-color: #fff; }

/* Catégories */
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.25rem; }
.category-card { display: block; position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; background: var(--secondary); text-decoration: none !important; }
.category-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.category-card:hover img { transform: scale(1.05); }
.category-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-size: 3rem; color: var(--primary); opacity: .7; }
.category-name { position: absolute; left: 0; right: 0; bottom: 0; padding: .75rem 1rem; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; font-weight: 700; font-size: 1.1rem; }

/* Produits */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.5rem; }
.product-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.05); transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,.1); }
.product-card-media { display: block; position: relative; aspect-ratio: 1; background: var(--secondary); overflow: hidden; }
.product-card-media img { width: 100%; height: 100%; object-fit: cover; }
.product-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-size: 4rem; color: var(--primary); opacity: .5; }
.product-placeholder.large { aspect-ratio: 1; border-radius: var(--radius); background: var(--secondary); }
.badge { position: absolute; top: .75rem; left: .75rem; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.badge-out { background: #777; }
.badge-sale { background: #c0392b; left: auto; right: .75rem; }
.product-card-body { padding: 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.product-card-title { font-size: 1.05rem; margin: 0; }
.product-card-title a { color: var(--text); }
.product-card-desc { color: var(--muted); font-size: .88rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-price { margin-top: auto; display: flex; gap: .6rem; align-items: baseline; }
.price { font-weight: 700; color: var(--primary); font-size: 1.1rem; }
.price-old { color: var(--muted); font-size: .9rem; }

/* Page produit */
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--muted); }
.product-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
.product-main-image { border-radius: var(--radius); overflow: hidden; background: var(--secondary); aspect-ratio: 1; }
.product-main-image img { width: 100%; height: 100%; object-fit: cover; }
.product-thumbs { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.product-thumbs .thumb { width: 72px; height: 72px; border-radius: calc(var(--radius) / 1.5); overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--secondary); cursor: pointer; }
.product-thumbs .thumb.active { border-color: var(--primary); }
.product-thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info h1 { margin-bottom: .5rem; }
.product-price { display: flex; gap: .75rem; align-items: baseline; margin-bottom: 1rem; }
.product-price .price { font-size: 1.6rem; }
.product-form { background: var(--surface); padding: 1.5rem; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.05); margin-bottom: 2rem; }
.qty-row { flex-direction: row; align-items: center; justify-content: space-between; }
.qty-input { display: inline-flex; border: 1px solid #d9d2d4; border-radius: 999px; overflow: hidden; }
.qty-input button { width: 38px; border: 0; background: var(--secondary); font-size: 1.2rem; cursor: pointer; color: var(--text); }
.qty-input input { width: 56px; text-align: center; border: 0; border-radius: 0; padding: .5rem 0; -moz-appearance: textfield; }
.qty-input input::-webkit-inner-spin-button { -webkit-appearance: none; }
.shipping-note { margin-top: 1rem; }
.rich-text h2 { margin-top: 1.5rem; }
.rich-text img { border-radius: var(--radius); margin: 1rem 0; }
.rich-text ul, .rich-text ol { padding-left: 1.4rem; }
.rich-text blockquote { border-left: 4px solid var(--primary); margin: 1rem 0; padding: .5rem 1rem; background: var(--secondary); border-radius: 0 var(--radius) var(--radius) 0; }

/* Boutique */
.page-head { background: var(--secondary); padding: clamp(1.5rem, 4vw, 3rem) 0; }
.page-head h1 { margin-bottom: .25rem; }
.page-head .lead { margin: 0; }
.shop-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip { padding: .4rem .9rem; border-radius: 999px; background: var(--surface); border: 1px solid #e3dcde; color: var(--text); font-weight: 600; font-size: .9rem; }
.chip:hover { text-decoration: none; border-color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.sort-form label { display: flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 600; }
.sort-form select { width: auto; padding: .4rem 2rem .4rem .8rem; }
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.pagination a { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; }
.pagination a.active { background: var(--primary); color: #fff; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state .btn { margin-top: .5rem; }

/* Blocs divers */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.step { background: var(--surface); padding: 1.75rem; border-radius: var(--radius); text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.step-num { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.2rem; margin-bottom: .75rem; font-family: var(--font-heading); }
.step p { color: var(--muted); margin: 0; }
.block-cta { background: var(--primary); color: #fff; }
.cta-inner { text-align: center; max-width: 720px; }
.cta-inner h2 { color: #fff; }
.cta-inner p { opacity: .9; font-size: 1.1rem; }
.block-image-text .image-text-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.block-image-text.image-right .image-text-media { order: 2; }
.image-text-media img { border-radius: var(--radius); width: 100%; }
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.testimonial { margin: 0; background: var(--surface); padding: 1.5rem; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.05); font-style: italic; }
.testimonial footer { font-style: normal; font-weight: 600; color: var(--primary); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.gallery-item { display: block; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery-item:hover img { transform: scale(1.05); }
.faq-item { background: var(--surface); border-radius: calc(var(--radius) / 1.5); padding: .25rem 1.25rem; margin-bottom: .75rem; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.faq-item summary { font-weight: 600; padding: .75rem 0; cursor: pointer; }
.faq-answer { padding: 0 0 1rem; color: var(--muted); white-space: pre-line; }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.contact-card { background: var(--surface); padding: 1.25rem; border-radius: var(--radius); display: flex; flex-direction: column; gap: .25rem; color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.contact-card:hover { text-decoration: none; box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.contact-card strong { color: var(--primary); }
.contact-card span { font-size: .9rem; color: var(--muted); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 1000; cursor: zoom-out; padding: 1rem; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* Cartes / mises en page */
.card { background: var(--surface); padding: 1.75rem; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.card h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.card h2 + h2, .card p + h2 { margin-top: 1.5rem; }
.contact-layout, .account-layout, .order-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: .6rem .5rem; text-align: left; border-bottom: 1px solid #eee; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.status-badge { display: inline-block; padding: .2rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #eee; color: #444; white-space: nowrap; }
.status-nouvelle { background: #e3eefb; color: #1f5fb0; }
.status-confirmee { background: #ece6fb; color: #5b3fc4; }
.status-en_fabrication { background: #fdf0d8; color: #a86a08; }
.status-expediee { background: #dcf3f3; color: #11706f; }
.status-livree { background: #e3f6e8; color: #20773a; }
.status-annulee { background: #fbe4e1; color: #a12b1f; }

/* Panier */
.cart-layout, .checkout-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 2rem; align-items: start; }
.cart-items { display: flex; flex-direction: column; gap: 1rem; }
.cart-item { display: grid; grid-template-columns: 90px 1fr auto; gap: 1rem; background: var(--surface); padding: 1rem; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.05); align-items: center; }
.cart-item-media { width: 90px; height: 90px; border-radius: calc(var(--radius) / 1.5); overflow: hidden; background: var(--secondary); }
.cart-item-media img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info strong a { color: var(--text); }
.cart-item-opts { color: var(--muted); font-size: .85rem; }
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.cart-item-total { font-weight: 700; color: var(--primary); }
.cart-remove { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .85rem; text-decoration: underline; }
.cart-summary { background: var(--surface); padding: 1.5rem; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.05); position: sticky; top: 90px; }
.cart-summary h2 { font-size: 1.25rem; }
.cart-summary .btn { margin-top: .75rem; }
.summary-row { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid #f0eaec; }
.summary-row.total { border-bottom: 0; font-size: 1.2rem; margin-top: .25rem; }
.cart-errors, .form-errors { background: #fdecea; color: #a12b1f; padding: .75rem 1rem; border-radius: calc(var(--radius) / 1.5); margin-top: 1rem; font-size: .9rem; }
.checkout-items { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
[data-compact] .cart-item { grid-template-columns: 54px 1fr auto; padding: .5rem; box-shadow: none; background: var(--bg); }
[data-compact] .cart-item-media { width: 54px; height: 54px; }
[data-compact] .qty-input, [data-compact] .cart-remove { display: none; }
.checkout-main h2 { margin-top: 1.5rem; font-size: 1.25rem; }
.checkout-main h2:first-of-type { margin-top: 0; }
.radio-cards { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.radio-card { display: flex; gap: .8rem; align-items: flex-start; background: var(--surface); padding: .9rem 1rem; border-radius: calc(var(--radius) / 1.3); border: 2px solid #ece5e7; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--primary); }
.radio-card input { margin-top: .3rem; accent-color: var(--primary); }
.radio-card > span { display: flex; flex-direction: column; }
.radio-card small { color: var(--muted); }
.price-tag { display: inline-block; margin-left: .4rem; padding: .05rem .55rem; border-radius: 999px; background: var(--secondary); color: var(--primary); font-size: .8rem; font-weight: 700; vertical-align: middle; }
.price-tag.free { background: #e3f6e8; color: #20773a; }
.grid-address { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr; gap: 0 1rem; }
@media (max-width: 480px) { .grid-address { grid-template-columns: 1fr; } }
.order-table { width: 100%; border-collapse: collapse; }
.order-table td { padding: .6rem .4rem; border-bottom: 1px solid #f0eaec; vertical-align: top; }
.order-table .num { text-align: right; white-space: nowrap; }
.order-table .sum td { border: 0; padding: .3rem .4rem; text-align: right; color: var(--muted); }
.order-table .total td { font-weight: 700; color: var(--text); font-size: 1.1rem; }
.order-item-media { width: 56px; }
.order-item-media img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.order-meta { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: #2e9e4f; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; margin-bottom: 1rem; }

/* Auth */
.auth-block { min-height: 60vh; display: flex; align-items: center; }
.auth-card { max-width: 440px; margin: 0 auto; background: var(--surface); padding: 2.25rem; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.08); text-align: center; }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: .25rem; }
.auth-card form { text-align: left; margin-top: 1.25rem; }
.auth-tabs { display: flex; background: var(--bg); border-radius: 999px; padding: 4px; margin-bottom: 1.5rem; }
.auth-tab { flex: 1; padding: .5rem; border-radius: 999px; font-weight: 600; color: var(--muted); }
.auth-tab.active { background: var(--surface); color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.auth-tab:hover { text-decoration: none; }
.auth-alt { margin-top: 1.25rem; margin-bottom: 0; font-size: .95rem; }
.divider { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: .85rem; margin: 1rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: #e8e1e3; }
.error-code { font-family: var(--font-heading); font-size: 4rem; color: var(--primary); line-height: 1; }

/* Pied de page */
.site-footer { background: var(--surface); border-top: 1px solid rgba(0,0,0,.06); margin-top: 3rem; padding-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem; }
.footer-brand { font-size: 1.3rem; }
.site-footer h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer a { color: var(--text); }
.social { display: flex; gap: .75rem; margin-top: .5rem; }
.social a { width: 38px; height: 38px; border-radius: 50%; background: var(--secondary); display: inline-flex; align-items: center; justify-content: center; color: var(--primary); }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.25rem 0; border-top: 1px solid rgba(0,0,0,.06); font-size: .85rem; color: var(--muted); }

/* Responsive */
@media (max-width: 900px) {
  .product-layout, .contact-layout, .account-layout, .order-layout, .cart-layout, .checkout-layout, .block-image-text .image-text-inner { grid-template-columns: 1fr; }
  .block-image-text.image-right .image-text-media { order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cart-summary { position: static; }
}
@media (max-width: 760px) {
  .burger { display: flex; }
  /* Pas de marge en bas : la derniere ligne de separation termine le panneau,
     sinon une bande blanche flotte en dessous. */
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 1rem 0; box-shadow: 0 12px 24px rgba(0,0,0,.1); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .7rem 0; border-bottom: 1px solid #f0eaec; }
  .nav-dropdown-menu { position: static; display: block; box-shadow: none; padding: 0 0 0 1rem; }
  .nav-dropdown-toggle { display: none; }
  .header-search { display: none; }
  .icon-label { display: none; }
  .header-inner { gap: .75rem; }
  .header-centered .brand { width: auto; padding: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 70px 1fr; }
  .cart-item-right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .auth-card { padding: 1.5rem; }
}

/* Bouton « voir le mot de passe » */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 2.8rem; }
.pw-toggle {
  position: absolute; top: 0; right: 0; height: 100%; width: 2.6rem;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted);
}
.pw-toggle:hover, .pw-toggle.on { color: var(--primary); }

/* Fenêtre de confirmation */
.modal-bg {
  position: fixed; inset: 0; z-index: 1100; padding: 1rem;
  background: rgba(20, 16, 18, .55);
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: var(--surface); color: var(--text); border-radius: var(--radius);
  padding: 1.6rem; max-width: 26rem; width: 100%;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
.modal-box h3 { margin: 0 0 .5rem; font-size: 1.2rem; }
.modal-box p { margin: 0 0 1rem; color: var(--muted); }
.confirm-word { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 1.1rem; }
.confirm-word input { width: 100%; margin-top: .35rem; }
.modal-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }
.btn-danger { background: #b3261e; color: #fff; border-color: #b3261e; }

/* Vider le panier */
.cart-clear { text-align: center; margin: 1rem 0 0; }
.cart-clear .link-btn { color: var(--muted); font-size: .88rem; }
.cart-clear .link-btn:hover { color: #b3261e; }

/* Ligne du panier à corriger : elle bloque la commande, elle doit se voir */
.cart-item-invalid { border: 1px solid #e9b5b1; background: #fdf4f3; }
.cart-item-invalid .cart-item-media { opacity: .55; }
.cart-item-alert { color: #b3261e; font-size: .88rem; margin: .25rem 0; }
.cart-item-invalid a.small { color: var(--primary); }
.btn.disabled { opacity: .5; cursor: not-allowed; }
.btn.disabled:hover { transform: none; box-shadow: none; }

/* Couleur obligatoire : tant qu'elle n'est pas choisie, on le dit */
.color-field.a-choisir input[type="color"] { border: 2px dashed #c9a0a8; }
.color-field.manquant input[type="color"] { border: 2px solid #b3261e; }
.color-field.manquant [data-color-hint] { color: #b3261e; font-weight: 600; }

/* Photo envoyée par la cliente dans la personnalisation */
.photo-field { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.photo-field .btn { padding: .5rem 1rem; }
.photo-preview { position: relative; width: 84px; height: 84px; border-radius: calc(var(--radius) / 1.5); overflow: hidden; border: 1px solid #ddd; background: var(--secondary); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-remove {
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; line-height: 1;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 1rem;
}
.photo-msg { flex: 1 1 100%; }
.photo-msg.err { color: #b3261e; font-weight: 600; }
.photo-field.manquant .btn { border-color: #b3261e; color: #b3261e; }
.photo-field.manquant .photo-msg { color: #b3261e; font-weight: 600; }
.cart-item-opts .opt-photo { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; vertical-align: middle; margin-right: .35rem; border: 1px solid #ddd; }
.cart-item-opts.with-photo { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }

/* Sous-catégories : second niveau du menu Catégories */
.nav-sub { position: relative; }
.nav-sub-toggle { display: flex !important; align-items: center; justify-content: space-between; gap: .75rem; }
.nav-sub-arrow { color: var(--muted); font-size: 1.1em; line-height: 1; }
.nav-sub-menu {
  display: none; position: absolute; top: -.5rem; left: 100%;
  background: var(--surface); box-shadow: 0 10px 30px rgba(0,0,0,.12);
  border-radius: calc(var(--radius) / 1.5); padding: .5rem 0; min-width: 180px; z-index: 30;
}
.nav-sub-menu a { display: block; padding: .5rem 1rem; border: 0; }
@media (min-width: 761px) {
  .nav-sub:hover .nav-sub-menu, .nav-sub:focus-within .nav-sub-menu { display: block; }
}
/* Si le sous-menu déborde à droite, il s'ouvre vers la gauche */
.nav-dropdown-menu .nav-sub:last-child .nav-sub-menu { top: auto; bottom: -.5rem; }


/* Tableaux : jamais plus larges que l'écran, quoi qu'ils contiennent */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Sur téléphone, chaque ligne devient un petit bloc lisible */
@media (max-width: 560px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: .75rem 0; border-bottom: 1px solid #eee; }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { border: 0; padding: .15rem 0; }
  .table-stack td[data-label]::before {
    content: attr(data-label) " ";
    display: inline-block; min-width: 5.5rem;
    color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em;
  }
  .table-stack td:not([data-label]) { margin-top: .35rem; }
}

/* Bouton de dépliage des sous-catégories : visible uniquement au téléphone */
.nav-sub-btn {
  display: none; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: 1rem; line-height: 1; padding: .7rem .5rem;
}
.nav-sub-btn[aria-expanded="true"] { transform: rotate(180deg); color: var(--primary); }

@media (max-width: 760px) {
  /* Le menu ne doit jamais dépasser l'écran : au-delà, il défile */
  .main-nav { max-height: calc(100vh - 70px); overflow-y: auto; -webkit-overflow-scrolling: touch; }

  /* « Catégories » redevient un bouton qui ouvre et referme la liste */
  .nav-dropdown-toggle { display: flex !important; align-items: center; justify-content: space-between; }
  .nav-dropdown-menu { position: static; display: none; box-shadow: none; padding: 0 0 0 1rem; min-width: 0; }
  .nav-dropdown.ouvert .nav-dropdown-menu { display: block; }

  /* Une sous-catégorie ne se déplie qu'au toucher du chevron, le nom reste cliquable */
  /* La ligne de separation appartient au groupe, pas au seul lien : sinon elle
     s'arrete avant le chevron. */
  .nav-sub { display: flex; flex-wrap: wrap; align-items: center; border-bottom: 1px solid #f0eaec; }
  .nav-sub > .nav-sub-toggle { flex: 1; display: block !important; border-bottom: 0; }
  .nav-sub-menu a:last-child { border-bottom: 0; }
  .nav-sub-arrow { display: none; }
  .nav-sub-btn { display: block; }
  .nav-sub-menu { position: static; display: none; box-shadow: none; padding: 0 0 0 1rem; min-width: 0; flex-basis: 100%; }
  .nav-sub.ouvert .nav-sub-menu { display: block; }
}

/* Flèche du menu « Catégories » : elle se retourne quand la liste est ouverte */
.nav-dropdown-arrow { display: inline-block; margin-left: .35rem; font-size: .85em; transition: transform .15s; }
.nav-dropdown.ouvert .nav-dropdown-arrow { transform: rotate(180deg); }
@media (min-width: 761px) {
  .nav-dropdown:hover .nav-dropdown-arrow, .nav-dropdown:focus-within .nav-dropdown-arrow { transform: rotate(180deg); }
}

/* Certains téléphones ont « Réduire les animations » activé. Sans cette règle,
   la transition reste figée sur son état de départ et la flèche ne tourne
   jamais. On supprime alors l'animation : le changement est instantané. */
@media (prefers-reduced-motion: reduce) {
  .nav-dropdown-arrow, .nav-sub-btn { transition: none; }
}
