/* Sélecteur de tailles (SSR) — fiche produit
 * Modes : stock-based (grille pastilles), onDemand (select), stockOut (notify)
 * Design : encadré clair, séparateur or, hiérarchie titre/select/status
 */

/* ─── Conteneur principal ─────────────────────────────── */
.size-selector {
  margin: 24px 0 20px;
  padding: 18px 18px 16px;
  border: 1px solid #ece6d8;
  border-left: 3px solid #d4af37;
  border-radius: 6px;
  background: #fdfcf8;
  font-family: Lato, sans-serif;
}

/* ─── En-tête : titre + lien guide ────────────────────── */
.size-selector-head {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.size-selector-title {
  font-family: Cinzel, serif;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a1a1a;
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}
.size-selector-guide {
  font-size: 0.78rem;
  color: #d4af37;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid rgba(212, 175, 55, 0.4);
  transition: border-color 0.15s ease;
}
.size-selector-guide:hover {
  color: #b8942e;
  border-bottom-color: #b8942e;
}

/* ─── Statut courant (label sous le titre) ────────────── */
.size-selector-current {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0 0 12px;
  line-height: 1.4;
}
.size-selector-current strong {
  color: #1a1a1a;
  font-weight: 600;
}

/* ─── Badge "Fabrication à la taille" (mode onDemand) ── */
.size-selector-current .ondemand-badge,
.size-selector-current span[style*="color:#92651a"] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fff8e6;
  border: 1px solid #f0d87c;
  border-radius: 4px;
  color: #92651a !important;
  font-size: 0.82rem !important;
  font-weight: 500;
}

/* ─── Sélecteur natif <select> (mode onDemand) ────────── */
.size-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: #fff
    url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%231a1a1a' stroke-width='2'%3e%3cpath d='M1 1l5 5 5-5'/%3e%3c/svg%3e")
    no-repeat right 16px center;
  border: 1px solid #d6cdb6;
  border-radius: 4px;
  padding: 12px 40px 12px 16px;
  font-family: Lato, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 46px;
  line-height: 1.2;
}
.size-select:hover {
  border-color: #1a1a1a;
}
.size-select:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}
.size-select option:disabled {
  color: #9ca3af;
}

/* ─── Grille pastilles (mode stock-based) ─────────────── */
.size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
}
.size-btn {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1px solid #d6cdb6;
  border-radius: 4px;
  padding: 10px 4px;
  font-family: Lato, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  min-height: 44px;
}
.size-btn:hover:not(:disabled):not(.size-btn--active) {
  border-color: #1a1a1a;
  background: #fafafa;
}
.size-btn--active {
  background: #1a1a1a;
  color: #d4af37;
  border-color: #1a1a1a;
}
.size-btn--unavailable {
  color: #9ca3af;
  background: #f9fafb;
  border-color: #e5e7eb;
  cursor: not-allowed;
  text-decoration: line-through;
}
.size-btn--unavailable:disabled {
  opacity: 0.7;
}
.size-btn--low-stock::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
}

/* ─── Pied : aide + délai (mode onDemand) ─────────────── */
.size-selector-help {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.4;
}
.size-selector-help svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: #d4af37;
}

/* ─── Indisponible (stockOutMode) ─────────────────────── */
.size-selector-empty {
  padding: 14px 16px;
  border-radius: 4px;
  background: #fff8e6;
  border: 1px solid #f0d87c;
  color: #92651a;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 8px;
}
.size-selector-empty strong {
  display: block;
  margin-bottom: 4px;
  color: #1a1a1a;
}
.size-selector-notify {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 18px;
  background: #1a1a1a;
  color: #d4af37;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease;
}
.size-selector-notify:hover {
  background: #2d2d2d;
}

/* ─── Statut disponibilité dynamique ──────────────────── */
.product-availability {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 6px;
  background: #fafaf7;
  border: 1px solid #ece6d8;
  font-family: Lato, sans-serif;
  font-size: 0.9rem;
  margin: 16px 0;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.product-availability__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.product-availability__label {
  font-weight: 500;
  line-height: 1.35;
}
.product-availability[data-tone="green"]  { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.product-availability[data-tone="amber"]  { background: #fffbeb; border-color: #fde68a; color: #92651a; }
.product-availability[data-tone="red"]    { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.product-availability[data-tone="gray"]   { background: #f9fafb; border-color: #e5e7eb; color: #4b5563; }

/* ─── Mobile ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .size-selector {
    padding: 14px 14px 12px;
    margin: 18px 0 16px;
  }
  .size-grid {
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  }
  .size-selector-head {
    gap: 10px;
  }
  .size-selector-guide {
    font-size: 0.74rem;
  }
  .product-availability {
    padding: 10px 12px;
    font-size: 0.85rem;
    gap: 8px;
  }
}
