/* ==========================================================================
   App BEMY, app boutiques : habillage « Vitrine » repris de l'app d'Andy & Co
   (forme uniquement). Chargé après styles.css, il ne change que l'apparence :
   fond blanc, produits sans cadre, formes très rondes, boutons d'achat foncés,
   dégradé de la marque (or pour Atout Beauté, rose pour Ma Beauté) pour
   Nouveautés, la barre panier et « Valider la commande ».
   Les couleurs viennent de la marque du client (config.js) ; valeurs par défaut :
   Atout Beauté. Page de connexion : seul le logo change.
   ========================================================================== */

:root:not(:has(.login)) {
  --bg: #FFFFFF;
  --white: #FFFFFF;
  --cta: var(--ink);         /* couleur des boutons d'achat */
  --cta-shadow: rgba(40, 20, 10, 0.22);
  --r-card: 22px;
  --nav-h: calc(80px + max(var(--safe-b), 12px));
}

body:not(:has(.login)) { background: var(--page); }
#app:not(:has(.login)) { background: #FFFFFF; }
:focus-visible:not(.login *) { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 12px; }

.serif:not(.login *) { letter-spacing: -0.005em; }
.h-24 { font-size: 26px; line-height: 30px; }
.t-name, .t-name-600 { font-weight: 600; }
.t-price, .t-price-14, .t-price-15, .price-xl { font-weight: 800; letter-spacing: -0.01em; }
.overline { font-size: 15px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }
.link-red { color: var(--muted); font-weight: 600; font-size: 14px; }

/* ---------- Boutons : des pastilles bien rondes ---------- */
.btn:not(.login *), .btn-58 { border-radius: 999px; font-weight: 700; }
.btn-outline { border: 1.5px solid var(--ink); }
/* boutons d'achat (ajouter, valider, confirmer la commande) : --cta ; « Retirer » et « Vider » restent rouges */
.btn-red:not(.login *):not([data-action="confirm-remove"]):not([data-action="confirm-clear"]) { background: var(--cta); box-shadow: 0 10px 22px var(--cta-shadow); }
.btn-dark-sm:not(.login *), .btn-outline-sm { border-radius: 999px; }
/* le « + » : noir, plus petit, zone de toucher gardée à 44 px */
.round-btn { width: 34px; height: 34px; background: var(--ink); color: #FFFFFF; position: relative; box-shadow: 0 4px 10px rgba(31, 26, 36, 0.16); }
.round-btn svg { width: 16px; height: 16px; }
.round-btn::after { content: ''; position: absolute; inset: -5px; border-radius: 999px; }
/* le « + » n'est jamais sur la photo : sous elle, à droite du prix */
.hcard { position: relative; }
.hcard-tile { position: static; }
.hcard .round-btn.on-tile { top: auto; right: 0; bottom: 2px; }
.hcard > .row-baseline { padding-right: 42px; }
.icon-btn.on-light { background: rgba(244, 243, 241, 0.92); }
.field:not(.login *) input { border-radius: 999px; padding: 0 20px; background: var(--soft); border-color: transparent; }
.field:not(.login *) textarea { border-radius: 20px; background: var(--soft); border-color: transparent; }
.field:not(.login *) input:focus, .field:not(.login *) textarea:focus { background: #FFFFFF; border-color: var(--ink); box-shadow: none; }
.search-box { border-radius: 999px; background: var(--soft); border-color: transparent; padding: 0 18px; }
.search-box:focus-within { background: #FFFFFF; border-color: var(--ink); }

/* ---------- Accueil : l'en-tête noir, la recherche sur une feuille blanche ---------- */
.pad-home { padding-top: 0; }
.pad-home > .home-head { position: relative; justify-content: center; margin: 0 -20px; padding: 16px 20px 0; height: 76px; background: var(--head); }
.logo-sm { width: auto; height: 42px; max-width: 168px; object-fit: contain; border-radius: 0; }
.pad-home > .home-head > .avatar { position: absolute; right: 20px; top: 22px; }
.pad-home > .home-head > .home-bell { position: absolute; left: 20px; top: 22px; margin: 0; background: rgba(255, 255, 255, 0.12); color: #FFFFFF; }
.home-bell-dot { background: #FFFFFF; color: var(--ink); }
.avatar { width: 44px; height: 44px; background: rgba(255, 255, 255, 0.12); color: #FFFFFF; font-size: 16px; }
.pad-home > .home-head + .stack-14 { margin-top: -44px; gap: 0; }
.pad-home > .home-head + .stack-14 > .col { align-items: center; text-align: center; margin: 0 -20px; padding: 10px 20px 50px; background: var(--head); }
.pad-home > .home-head + .stack-14 .t-muted-14 { display: none; }
.pad-home > .home-head + .stack-14 h1 { font-size: 30px; line-height: 34px; color: #FFFFFF; }
.pad-home > .home-head + .stack-14 > .search { position: relative; margin: -28px -20px 0; padding: 22px 20px 0; background: #FFFFFF; border-radius: 28px 28px 0 0; }

.pad-home.stack-26 { gap: 44px; }
.sec-head h2 { font-size: 27px; line-height: 31px; }
.notif { align-items: center; padding: 10px 6px 10px 12px; border-radius: 18px; background: var(--soft); color: var(--ink); }
.notif .t-body-14 { color: var(--ink); font-weight: 500; }
.notif-ico { width: 32px; height: 32px; color: var(--ink); background: transparent; border-radius: 999px; }
.notif-x { color: var(--muted); }

/* produits sans cadre, nulle part : aucune différence entre l'article et le fond */
.hcard { width: 164px; }
.hcard-tile, .pcard-tile, .mini-tile { border: 0; border-radius: 0; background: #FFFFFF; overflow: hidden; }
.hcard-tile img, .pcard-tile img, .mini-tile img { padding: 0; }
.hcard-tile > a { display: block; width: 100%; height: 100%; }
.hcard-tile.is-in, .pcard-tile.is-in { border: 0; }
.chip-qty { top: 0; left: 0; background: var(--ink); border-radius: 999px; }
.panel { border: 0; padding: 0; gap: 4px; background: transparent; }
.panel.stack-12 { padding: 0; }
.badge-stock { display: none; }

/* Best-sellers : sans classement. Le premier en grand, les suivants en liste */
.best-rank { display: none; }
.panel > .t-sub-13 { font-size: 14px; color: var(--muted); }
.best-list { margin-top: 6px; }
.best-item { position: relative; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.best-link { gap: 16px; }
.best-link img { width: 64px; height: 64px; border-radius: 0; background: #FFFFFF; padding: 0; }
.best-item:last-child { border-bottom: 0; }

/* Sélections : le produit seul sur le blanc, le nom dessous */
.sel-card { height: auto; padding: 0; gap: 2px; border-radius: 0; overflow: visible; background: transparent !important; }
.sel-card img { position: static; order: -1; width: 100%; height: auto; aspect-ratio: 1 / 1; margin-bottom: 10px; padding: 0; border-radius: 0; background: #FFFFFF; box-shadow: none; }
.sel-card .t-strong-16 { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 26px; color: var(--ink); }
.sel-card .t-sub-13 { color: var(--muted); }

/* L'actualité en billet clair : encoches et pointillés */
.event-card {
  flex-direction: row-reverse; justify-content: space-between; gap: 16px;
  padding: 20px 24px 20px 26px; border-radius: var(--r-card); background: var(--soft); color: var(--ink);
  -webkit-mask: radial-gradient(circle 10px at left center, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 10px at right center, #0000 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 10px at left center, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 10px at right center, #0000 98%, #000) right / 51% 100% no-repeat;
}
.event-card .t-strong { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 26px; color: var(--ink); }
.event-sub { font-size: 14px; line-height: 20px; color: var(--muted); }
.event-ico { width: 48px; height: 60px; border-radius: 0; background: transparent; color: var(--ink); border-left: 1.5px dashed rgba(31, 26, 36, 0.2); padding-left: 14px; justify-content: flex-end; }
.event-ico svg { width: 26px; height: 26px; }

/* Le bas de l'accueil : le sceau, seul */
.pad-home::after { content: ''; display: block; height: 56px; margin: 4px 0 0; background: var(--sceau) center / 52px 52px no-repeat; }

/* ---------- Catalogue ---------- */
/* Nouveautés : un seul bloc en dégradé, les produits détourés posés dedans (aucun cadre par photo) */
.promo { position: relative; border-radius: var(--r-card); min-height: 132px; padding: 0 12px 0 22px; color: #FFFFFF; overflow: hidden;
  background: var(--joy); }
.promo-eyebrow { font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: rgba(255, 255, 255, 0.9); }
.promo-title { font-size: 32px; line-height: 34px; }
.promo-imgs { align-self: center; align-items: center; }
.promo-imgs img { width: 92px; height: 104px; padding: 0; border-radius: 0; background: transparent; object-fit: contain; object-position: bottom; }
.promo-imgs .rot-l { transform: rotate(-5deg); }
.promo-imgs .rot-r { transform: rotate(4deg); margin-left: -14px; }

/* Catégories : intérieur blanc, contour en dégradé de couleur */
.type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.type-tile { position: relative; display: block; height: 142px; padding: 10px 10px; border: 2px solid transparent; border-radius: 20px; overflow: hidden; color: var(--ink);
  background: linear-gradient(#FFFFFF, #FFFFFF) padding-box, linear-gradient(160deg, var(--g1), var(--g2)) border-box; }
.type-tile .col { position: relative; z-index: 1; padding: 0; gap: 1px; }
.type-tile .t-strong-14 { font-family: var(--sans); font-weight: 700; font-size: 15px; line-height: 18px; color: var(--ink); }
.type-tile .t-sub { display: none; }
.type-img { position: absolute; left: 10px; right: 10px; bottom: 8px; width: auto; height: 50%; aspect-ratio: auto; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.type-img img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.type-img img, .promo-imgs img { transition: opacity 0.2s ease; }
.type-img img[data-cut="wait"], .promo-imgs img[data-cut="wait"] { opacity: 0; }
/* contours des tuiles : teintes du catalogue (or, caramel, rose poudré, nude, sauge, taupe…) */
.type-tile:nth-child(10n+1) { --g1: #8F6C46; --g2: #EDBC80; }
.type-tile:nth-child(10n+2) { --g1: #B8577A; --g2: #F2B3C8; }
.type-tile:nth-child(10n+3) { --g1: #6E4520; --g2: #C49867; }
.type-tile:nth-child(10n+4) { --g1: #A9704F; --g2: #EAC3A4; }
.type-tile:nth-child(10n+5) { --g1: #6F7A5A; --g2: #BCC6A2; }
.type-tile:nth-child(10n+6) { --g1: #8C6F86; --g2: #D7BED0; }
.type-tile:nth-child(10n+7) { --g1: #A3833F; --g2: #E8D18F; }
.type-tile:nth-child(10n+8) { --g1: #7C6A60; --g2: #CDBFB5; }
.type-tile:nth-child(10n+9) { --g1: #9C4E3C; --g2: #E5A58E; }
.type-tile:nth-child(10n+10) { --g1: #5E3D2B; --g2: #B99579; }
/* Ma Beauté : roses et prunes de la couverture */
:root[data-marque="ma-beaute"] .type-tile:nth-child(10n+1) { --g1: #C2406F; --g2: #F5A3C2; }
:root[data-marque="ma-beaute"] .type-tile:nth-child(10n+2) { --g1: #8E3A6B; --g2: #D9A1C4; }
:root[data-marque="ma-beaute"] .type-tile:nth-child(10n+3) { --g1: #E95A8D; --g2: #F8CADB; }
:root[data-marque="ma-beaute"] .type-tile:nth-child(10n+4) { --g1: #A8566A; --g2: #EDB8C3; }
:root[data-marque="ma-beaute"] .type-tile:nth-child(10n+5) { --g1: #7D4F8C; --g2: #CFB3DD; }
:root[data-marque="ma-beaute"] .type-tile:nth-child(10n+6) { --g1: #B04A57; --g2: #F2B0A8; }
:root[data-marque="ma-beaute"] .type-tile:nth-child(10n+7) { --g1: #C76E95; --g2: #F6C7DA; }
:root[data-marque="ma-beaute"] .type-tile:nth-child(10n+8) { --g1: #7D6571; --g2: #D2C2CA; }
:root[data-marque="ma-beaute"] .type-tile:nth-child(10n+9) { --g1: #9E2D57; --g2: #E78BAE; }
:root[data-marque="ma-beaute"] .type-tile:nth-child(10n+10) { --g1: #5E3D50; --g2: #C2A2B5; }
.tabs { border-bottom: 0; gap: 8px; padding: 0; }
.tab { height: 40px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 600; }
.tab.is-active { background: var(--ink); color: #FFFFFF; border-color: var(--ink); font-weight: 700; }
.pgrid { gap: 30px 16px; }
.pcard-buy { align-items: center; }
.badge-new { top: 0; left: 0; background: var(--ink); border-radius: 999px; text-transform: lowercase; font-weight: 700; letter-spacing: 0.01em; font-size: 10.5px; }
.badge-new::first-letter { text-transform: uppercase; }
.stepper-dark { height: 40px; background: var(--ink); }
.stepper-dark button { height: 40px; }
/* barre panier : le même dégradé que Nouveautés */
.cartbar { border-radius: 999px; padding: 8px 8px 8px 24px; background: var(--joy); box-shadow: 0 14px 30px var(--joy-shadow); }
.cartbar-meta { color: rgba(255, 255, 255, 0.9); }
.cartbar-cta { border-radius: 999px; height: 44px; padding: 0 18px; color: var(--cta); }
.empty-inline { border-radius: var(--r-card); border: 0; background: var(--soft); }

/* ---------- Fiche produit : même typographie que dans le catalogue ---------- */
.product-main h1.serif { font-family: var(--sans); font-weight: 600; font-size: 26px; line-height: 31px; letter-spacing: -0.01em; }
.gallery { border-bottom: 0; }
.gallery-main { height: 420px; }
.thumb { border: 0; border-radius: 0; }
.thumb.is-active { border: 0; box-shadow: inset 0 -2px 0 var(--ink); }
.dot-badge { background: var(--ink); }
.spec { border-radius: 18px; border: 0; background: var(--soft); }
.in-cart { border-radius: 999px; }
.buybar { border-top: 0; box-shadow: 0 -12px 30px rgba(31, 26, 36, 0.06); }
.stepper-light { border-radius: 999px; background: var(--soft); border-color: transparent; }

/* ---------- Panier, validation ---------- */
.card-list { border: 0; border-radius: 0; background: transparent; }
.card-list > li { border-bottom-color: var(--line); }
.cart-line { padding: 16px 0; }
.thumb-76 { background: #FFFFFF; border-radius: 0; padding: 0; }
.stepper-line { border-radius: 999px; background: var(--soft); border-color: transparent; }
.totals, .recap, .info-card, .order-card, .help-card:not(.login *) { border-radius: var(--r-card); border-color: var(--line); }
.totals .totals-final dt { font-family: var(--serif); font-weight: 400; font-size: 21px; }
.totals .totals-final dd { font-size: 20px; }
.totals dt { white-space: nowrap; }
.avatars img { border: 0; border-radius: 0; box-shadow: none; padding: 0; background: #FFFFFF; }
.avatars .ml-12 { margin-left: 8px; }
.validate-bar { background: linear-gradient(rgba(255, 255, 255, 0), #FFFFFF 40%); border-top: 0; padding-top: 18px; }
/* Valider la commande et Confirmer la commande : le même bouton (dégradé, montant dans une pastille blanche) */
.validate-bar .btn.btn-red.btn-58:not(.login *), .confirm-bar .btn.btn-red.btn-58:not(.login *), .sheet .btn.upsell-go:not(.login *) { justify-content: space-between; padding-right: 8px; background: var(--joy); box-shadow: 0 14px 30px var(--joy-shadow); }
.validate-bar .btn.btn-58 > span:last-child, .confirm-bar .btn.btn-58 > span:last-child:not(:first-child) { display: flex; align-items: center; height: 42px; padding: 0 16px; border-radius: 999px; background: #FFFFFF; color: var(--ink); font-size: 15px; }
.sheet .btn.upsell-go:not(.login *) { justify-content: center; padding-right: 20px; }
.confirm-bar { border-top: 0; box-shadow: 0 -12px 30px rgba(31, 26, 36, 0.06); }
.radio-card { border-radius: 20px; }
.radio-card.is-active { border: 1.5px solid var(--ink); padding: 13.5px 15.5px; }
.radio-card.is-active .radio-ring { border-color: var(--ink); }
.choice { border-radius: 999px; }
.choice.is-active { border: 1.5px solid var(--ink); }
.pay-ico { border-radius: 999px; }

/* ---------- Confirmation : le sceau ---------- */
.big-check { width: 104px; height: 104px; background: var(--sceau) center / cover no-repeat; box-shadow: none; }
.big-check svg { display: none; }
.sales-card { background: var(--soft); border-radius: var(--r-card); }
.sales-avatar { background: var(--ink); font-family: var(--serif); font-weight: 400; font-size: 19px; }

/* ---------- Compte ---------- */
.shop-card { border-radius: var(--r-card); background: var(--soft); color: var(--ink); padding: 18px; }
.shop-mono { background: var(--ink); color: #FFFFFF; border-radius: 999px; font-family: var(--serif); }
.shop-sub { color: var(--muted); }
.coll-chip { padding: 0; border-radius: 0; background: transparent !important; color: var(--ink) !important; font-size: 14px; }
.coll-chip img { width: 44px; height: 56px; border-radius: 0; }
.status { border-radius: 999px; }
.tracker li span { height: 4px; }
.tracker li.is-done span { background: var(--ink); }

/* ---------- Connexion : seul le logo change ---------- */
.login-logo img { width: 250px; height: auto; max-height: 72px; object-fit: contain; border-radius: 0; box-shadow: none; filter: drop-shadow(0 2px 12px rgba(30, 12, 4, 0.45)); }

/* ---------- Feuilles, messages ---------- */
.sheet { background: #FFFFFF; border-radius: 30px 30px 0 0; }
.toast { border-radius: 999px; }

/* ---------- Navigation : la barre noire flottante (téléphone, iPad vertical) ---------- */
@media (max-width: 1023px) {
  .tabbar {
    bottom: calc(10px + var(--safe-b)); width: calc(min(100%, var(--app-w)) - 28px); height: 66px;
    padding: 6px; border: 0; border-radius: 999px; background: var(--ink);
    align-items: center; justify-content: space-between; gap: 2px;
    box-shadow: 0 16px 34px rgba(31, 26, 36, 0.28);
  }
  .nav-item { flex: 1; width: auto; height: 54px; border-radius: 999px; color: rgba(255, 255, 255, 0.78); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
  .nav-item.is-active { flex: 1.45; flex-direction: row; gap: 8px; background: #FFFFFF; color: var(--ink); font-size: 14px; font-weight: 800; }
  .nav-badge { top: 4px; right: calc(50% - 24px); background: #FFFFFF; color: var(--ink); border-color: var(--ink); }
  .nav-item.is-active .nav-badge { position: static; background: var(--ink); color: #FFFFFF; border-color: #FFFFFF; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .tabbar { width: 520px; }
}

/* ---------- iPad et ordinateur ---------- */
@media (min-width: 768px) {
  .type-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
  .type-tile { height: 190px; padding: 14px; }
  .type-tile .t-strong-14 { font-size: 17px; line-height: 21px; }
  .type-img { height: 60%; }
  /* grand écran : l'en-tête devient un bloc noir arrondi */
  .pad-home { padding-top: 28px; }
  .pad-home > .home-head { margin: 0; padding: 20px 32px 0; border-radius: var(--r-card) var(--r-card) 0 0; }
  .pad-home > .home-head + .stack-14 > .col { margin: 0; padding: 12px 32px 32px; border-radius: 0 0 var(--r-card) var(--r-card); }
  .pad-home > .home-head + .stack-14 > .search { margin: 24px 0 0; padding: 0; border-radius: 0; background: transparent; }
  .product-main .gallery { border: 0; }
  .product-main .buybar { border: 0; border-radius: var(--r-card); background: var(--soft); box-shadow: none; }
}
@media (min-width: 1024px) {
  #app.has-nav .nav-item { border-radius: 18px; }
  #app.has-nav .nav-item.is-active { background: var(--ink); color: #FFFFFF; }
  #app.has-nav .nav-item.is-active .nav-badge { border-color: var(--ink); }
  #app.has-nav .nav-item.is-active:hover { color: #FFFFFF; }
}
@media (hover: hover) and (min-width: 768px) {
  .pcard-tile:hover, .hcard-tile:hover, .mini-tile:hover, .type-tile:hover .type-img { box-shadow: none; }
  .type-tile:hover { filter: brightness(1.04); }
  .pcard-tile:hover img, .hcard-tile:hover img, .type-tile:hover .type-img img { transform: scale(1.03); transition: transform 0.25s ease; }
}
