/* ═══════════════════════════════════════════════════════════════════════════
   Modale de choix de taille (fiche produit variable)
   Voir inc/size-picker.php et assets/js/size-picker.js.
   Centrée sur ordinateur, en panneau bas sur mobile.
   ═══════════════════════════════════════════════════════════════════════════ */

.uc-sizepicker {
  --uc-sp-ink: #0A0A0B;
  --uc-sp-muted: #63676F;
  --uc-sp-line: #D9DCE2;
  --uc-sp-soft: #F4F5F7;
  --uc-sp-brand: #6699FF;       /* bouton « Ajouter au panier » du thème */
  --uc-sp-brand-hover: #5089FB;
  --uc-sp-focus: #1D4FD8;

  width: min(100% - 2rem, 30rem);
  max-height: min(100dvh - 2rem, 40rem);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: var(--uc-sp-ink);
  box-shadow: 0 24px 60px -20px rgba(10, 10, 11, .45);
  overflow: auto;
  overscroll-behavior: contain;
}
.uc-sizepicker::backdrop {
  background: rgba(10, 10, 11, .55);
}
.uc-sizepicker[open] { animation: uc-sp-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes uc-sp-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.uc-sizepicker *, .uc-sizepicker *::before, .uc-sizepicker *::after { box-sizing: border-box; }
.uc-sizepicker :focus-visible { outline: 3px solid var(--uc-sp-focus); outline-offset: 2px; }

.uc-sizepicker__inner {
  display: flex; flex-direction: column; gap: 1.1rem;
  padding: 1.25rem 1.25rem 1.35rem;
}

/* Rappel produit */
.uc-sizepicker__product {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--uc-sp-line);
}
.uc-sizepicker__thumb {
  width: 64px; height: 64px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--uc-sp-soft);
}
.uc-sizepicker__name {
  margin: 0 0 .15rem;
  font-size: .9375rem; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.uc-sizepicker__price { margin: 0; font-size: .9375rem; line-height: 1.3; }
.uc-sizepicker__price del { opacity: .55; margin-right: .3rem; font-size: .875em; }
.uc-sizepicker__price ins { text-decoration: none; font-weight: 600; }
.uc-sizepicker__price .onsale,
.uc-sizepicker__price [class*="sale-item"] { display: none; }

.uc-sizepicker__close {
  align-self: start;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  margin: -.35rem -.35rem 0 0;
  padding: 0;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--uc-sp-ink);
  cursor: pointer;
}
.uc-sizepicker__close:hover { background: var(--uc-sp-soft); }
.uc-sizepicker__close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.uc-sizepicker .uc-sizepicker__title {
  margin: 0;
  font-size: 1.25rem; font-weight: 700; line-height: 1.2; letter-spacing: -.01em;
}

/* Tailles */
.uc-sizepicker__groups { display: grid; gap: 1rem; }
.uc-sizepicker__group { margin: 0; padding: 0; border: 0; min-width: 0; }
.uc-sizepicker__group legend:not(.screen-reader-text) {
  margin-bottom: .5rem; padding: 0;
  font-size: .875rem; font-weight: 600;
}
.uc-sizepicker__options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
  gap: .5rem;
}
.uc-sizepicker__option {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 48px;
  padding: .35rem .4rem;
  border: 1.5px solid var(--uc-sp-line);
  border-radius: 10px;
  background: #fff;
  font-size: .9375rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center; line-height: 1.15;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.uc-sizepicker__radio {
  position: absolute; inset: 0;
  margin: 0; opacity: 0;
  cursor: pointer;
}
.uc-sizepicker__option:hover { border-color: var(--uc-sp-ink); }
.uc-sizepicker__option:has(.uc-sizepicker__radio:focus-visible) {
  outline: 3px solid var(--uc-sp-focus); outline-offset: 2px;
}
.uc-sizepicker__option:has(.uc-sizepicker__radio:checked) {
  border-color: var(--uc-sp-ink);
  background: var(--uc-sp-ink);
  color: #fff;
}
.uc-sizepicker__option.is-unavailable {
  border-style: dashed;
  background: var(--uc-sp-soft);
  color: #A3A7AF;
  text-decoration: line-through;
  cursor: not-allowed;
}
.uc-sizepicker__option.is-unavailable .uc-sizepicker__radio { cursor: not-allowed; }

/* Pied : guide des tailles + ajout */
.uc-sizepicker__footer {
  display: flex; flex-direction: column; align-items: stretch; gap: .75rem;
  padding-top: .25rem;
}
.uc-sizepicker__guide {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--uc-sp-ink);
  font-size: .875rem; font-weight: 600;
  text-decoration: underline; text-underline-offset: .2em;
  cursor: pointer;
}
.uc-sizepicker__submit {
  min-height: 52px;
  padding: .8rem 1.25rem;
  border: 0; border-radius: 8px;
  background: var(--uc-sp-brand);
  color: #fff;
  font-size: 1.0625rem; font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, opacity .15s ease;
}
.uc-sizepicker__submit:hover:not(:disabled) { background: var(--uc-sp-brand-hover); }
.uc-sizepicker__submit:disabled { opacity: .45; cursor: not-allowed; }

/* Mobile : panneau qui monte du bas, pouce au niveau des tailles et du bouton */
@media (max-width: 37.5em) {
  .uc-sizepicker {
    width: 100%;
    max-width: none;
    max-height: 88dvh;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }
  .uc-sizepicker[open] { animation-name: uc-sp-up; }
  .uc-sizepicker__inner { padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); }
  .uc-sizepicker__options { grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr)); }
}
@keyframes uc-sp-up {
  from { transform: translateY(100%); }
  to   { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .uc-sizepicker[open] { animation: none; }
  .uc-sizepicker__option, .uc-sizepicker__submit { transition: none; }
}
