/* ============================================================================
   style.css — Nya-Boutique (site visiteur). Mobile d'abord, grille 2×2.
   La couleur principale vient de config.js (variable --brand).
   ============================================================================ */
:root {
  --brand: #2563eb;
  --brand-dark: color-mix(in srgb, var(--brand) 62%, #000);
  --brand-soft: color-mix(in srgb, var(--brand) 10%, #fff);
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --line: #e5e9f2;
  --bg: #f3f5fa;
  --card: #fff;
  --amber: #f59e0b;
  --deal: #e11d48;
  --wa: #12a84f;
  --wa-dark: #0c8a3e;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 8px rgba(15, 23, 42, .06);
  --sh-2: 0 8px 22px rgba(15, 23, 42, .12);
  --top-h: 92px;
  /* hauteur de la zone fixe : recalculée par app.js */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:where(a, button, input, textarea):focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* ───────── Zone fixe : bande + en-tête ───────── */
.top-fixed {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
}

.ticker {
  height: 34px;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--brand) 38%, #000);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
}

.ticker-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: nb-defile var(--dur, 30s) linear infinite;
}

.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track {
  animation-play-state: paused;
}

.ticker-set {
  display: flex;
  flex: none;
  align-items: center;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 0 22px;
  color: inherit;
  text-decoration: none;
}

.ticker-item::after {
  content: '◆';
  margin-left: 44px;
  color: var(--amber);
  font-size: .6rem;
}

a.ticker-item {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes nb-defile {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker {
    overflow-x: auto;
  }

  .ticker-track {
    animation: none;
  }
}

.site-header {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  color: #fff;
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  box-shadow: 0 8px 24px rgba(10, 31, 68, .25);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  border: 2px solid rgba(255, 255, 255, .7);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-name {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-btn {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .32);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s;
}

.cart-btn:active {
  transform: scale(.94);
}

.cart-btn.bump {
  animation: nb-bump .4s;
}

@keyframes nb-bump {
  40% {
    transform: scale(1.18);
  }
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--deal);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  border: 2px solid var(--brand-dark);
}

main {
  padding: calc(var(--top-h) + 12px) 12px 28px;
  max-width: 760px;
  margin: 0 auto;
}

/* ───────── Grille 2×2 ───────── */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh-2);
  }
}

.card:active {
  transform: scale(.985);
}

.card-img {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #eef1f8;
  overflow: hidden;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s;
}

.card-img img.ok {
  opacity: 1;
}

.badge-promo {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--deal);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(225, 29, 72, .35);
}

.card-body {
  padding: 9px 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-name {
  margin: 0;
  font-size: .86rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.card-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
}

.price {
  font-weight: 800;
  color: #2563eb;
  font-size: .95rem;
}

/* prix actuel : bleu */
.price-old {
  color: #dc2626;
  font-size: .76rem;
  font-weight: 600;
  text-decoration: line-through;
  text-decoration-color: #dc2626;
  text-decoration-thickness: 1.5px;
}

/* vrai prix : barré en rouge */
.skeleton .card-img,
.skeleton .sk-line {
  background: linear-gradient(90deg, #e9edf5 25%, #f5f7fb 50%, #e9edf5 75%);
  background-size: 200% 100%;
  animation: nb-sk 1.2s linear infinite;
}

.sk-line {
  height: 12px;
  border-radius: 6px;
  margin: 4px 0;
}

@keyframes nb-sk {
  to {
    background-position: -200% 0;
  }
}

#sentinel {
  height: 1px;
}

.state-msg {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

.state-msg button {
  margin-top: 12px;
}

/* ───────── Vue détail ───────── */
#detail-view {
  padding-bottom: 96px;
}

/* place pour le bouton flottant */
.gallery {
  position: relative;
}

.g-main {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  background: #eef1f8;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  touch-action: pan-y;
}

.g-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.g-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .88);
  color: var(--ink);
  box-shadow: var(--sh-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.g-prev {
  left: 8px;
}

.g-next {
  right: 8px;
}

.g-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(15, 23, 42, .65);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.g-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.g-thumb {
  aspect-ratio: 1/1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #eef1f8;
  opacity: .6;
}

.g-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g-thumb.active {
  border-color: var(--brand);
  opacity: 1;
}

.d-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 16px;
  margin-top: 12px;
}

.d-name {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
}

.d-price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 10px;
}

.d-price .price {
  font-size: 1.35rem;
}

.d-price .price-old {
  font-size: .95rem;
}

.d-price .badge-promo {
  position: static;
}

.d-desc {
  margin: 0 0 4px;
  white-space: pre-line;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.d-h {
  margin: 14px 0 6px;
  font-size: .95rem;
  font-weight: 800;
  color: var(--ink);
}

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.features li {
  position: relative;
  padding-left: 22px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--wa);
  font-weight: 800;
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 14px;
}

.actions .btn-order {
  grid-column: 1 / -1;
}

.btn {
  min-height: 46px;
  border-radius: 999px;
  border: 0;
  font-weight: 800;
  font-size: .95rem;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s, filter .2s;
}

.btn:active {
  transform: scale(.97);
}

.btn-order {
  background: linear-gradient(135deg, #1fbf6a, var(--wa));
  color: #fff;
  box-shadow: 0 8px 18px rgba(18, 168, 79, .3);
}

.btn-add {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 2px solid var(--brand);
}

.btn-add.done {
  background: var(--brand);
  color: #fff;
}

.btn-share {
  width: 46px;
  padding: 0;
  background: #fff;
  color: var(--brand);
  border: 2px solid var(--line);
}

.btn-wa {
  background: linear-gradient(135deg, #2be074, var(--wa));
  color: #fff;
  width: 100%;
  min-height: 50px;
  box-shadow: 0 10px 22px rgba(18, 168, 79, .32);
}

.more-info {
  border-left: 4px solid var(--amber);
}

.more-info h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.more-info p {
  margin: 0;
  white-space: pre-line;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.all-btn {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 3px solid #135fda;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: .92rem;
  box-shadow: var(--sh-2), 0 0 15px rgba(15, 79, 182, 0.848);
  white-space: nowrap;
  animation: nb-up .3s ease-out;
}


@keyframes nb-up {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
}

/* ───────── Pied de page : infos de la boutique ───────── */
.shop-info {
  margin-top: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 18px 16px;
}

.shop-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.shop-head .brand-logo {
  width: 46px;
  height: 46px;
  background: var(--brand-soft);
  border-color: var(--line);
}

.shop-head h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--ink);
  font-weight: 800;
}

.shop-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 8px 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.shop-row svg {
  flex: none;
  margin-top: 2px;
  color: var(--brand);
}

.shop-desc {
  margin: 8px 0 4px;
  white-space: pre-line;
  line-height: 1.55;
}

.shop-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.shop-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .88rem;
  text-decoration: none;
}

.link-wa {
  background: var(--wa);
  color: #fff;
}

.link-map {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.copyright {
  margin-top: 14px;
  text-align: center;
  color: var(--muted);
  font-size: .76rem;
}

/* ───────── Fenêtre panier ───────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 48, .6);
  backdrop-filter: blur(5px);
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 26px 26px 0 0;
  box-shadow: var(--sh-2);
  animation: nb-sheet .28s ease-out;
}

@keyframes nb-sheet {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}

@media (min-width: 700px) {
  .modal {
    align-items: center;
  }

  .modal-box {
    border-radius: 26px;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 8px;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: #f1f5f9;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 4px 18px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cart-empty {
  padding: 30px 0;
  text-align: center;
  color: var(--muted);
}

.cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #eef1f8;
}

.ci-name {
  font-weight: 700;
  color: var(--ink);
  font-size: .9rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ci-price {
  color: var(--muted);
  font-size: .8rem;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.qty button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qty span {
  min-width: 20px;
  text-align: center;
  font-weight: 800;
  color: var(--ink);
}

.ci-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 6px;
  font-size: 1.05rem;
  color: var(--ink);
}

.cart-total strong {
  color: var(--brand);
  font-size: 1.2rem;
}

.order-form {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.order-note {
  margin: 0 0 6px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: #ecfdf5;
  border-left: 4px solid var(--wa);
  color: #065f46;
  font-size: .84rem;
}

.order-form label {
  font-weight: 700;
  font-size: .82rem;
  color: var(--ink);
  margin-top: 4px;
}

.order-form input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 16px;
  background: #fbfcfe;
  color: var(--ink);
}

.order-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
  outline: none;
  background: #fff;
}

.form-error {
  margin: 4px 0 0;
  color: var(--deal);
  font-weight: 700;
  font-size: .85rem;
}

.order-form .btn-wa {
  margin-top: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  box-shadow: var(--sh-2);
  max-width: calc(100vw - 32px);
  text-align: center;
}

@media (min-width: 700px) {
  main {
    padding-left: 20px;
    padding-right: 20px;
  }

  .grid {
    gap: 14px;
  }

  .card-name {
    font-size: .95rem;
  }

  .site-header {
    padding: 0 max(14px, calc((100vw - 760px) / 2));
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Position GPS du client (commande) ── */
.geo-row {
  margin: 2px 0 4px;
}

.btn-geo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px dashed #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font: inherit;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
}

.btn-geo:disabled {
  opacity: .6;
  cursor: wait;
}

.geo-status {
  margin: 6px 0 0;
  font-size: .8rem;
  color: #475569;
}

.geo-status.ok {
  color: #047857;
  font-weight: 700;
}

.geo-status.ko {
  color: #b91c1c;
}

.geo-status button {
  background: none;
  border: 0;
  padding: 0 0 0 6px;
  color: #1d4ed8;
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
}