/* ══════════════════════════════════════════════════
   PUPUCE PRIME — Composants partagés (boutique)
   Complémente home.css pour les modals, cart, forms
   ══════════════════════════════════════════════════ */

/* ── Variables legacy (compat style.css) ────────── */
:root {
  --rose-mist:   var(--accent-mist);
  --rose-pop:    var(--accent);
  --rose-sig:    var(--accent);
  --charcoal:    #111113;
  --muted:       #74777B;
  --border-light:#E1E1E4;
  --radius:      14px;
  --radius-sm:   10px;
  --bg:          #F7F7F8;
  --primary-grad:var(--accent-grad);
}

/* ── Modal overlay ───────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(17,17,19,0.55);
  z-index: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: white;
  border-radius: 20px;
  max-width: 640px; width: 100%;
  box-shadow: 0 24px 80px rgba(17,17,19,0.18);
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(.4,0,.2,1);
  overflow: hidden; max-height: 92vh;
  display: flex; flex-direction: column;
}
.modal-overlay.open .modal-box { opacity: 1; }
.modal-box-sm { max-width: 420px; }

.modal-close-btn {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px;
  border: none; background: rgba(17,17,19,0.15);
  border-radius: 50%; cursor: pointer;
  font-size: 1rem; display: flex;
  align-items: center; justify-content: center;
  color: white; transition: background 0.15s;
}
.modal-close-btn:hover { background: rgba(17,17,19,0.35); }
.modal-close-btn-dark {
  background: rgba(17,17,19,0.08); color: #111113;
}
.modal-close-btn-dark:hover { background: rgba(17,17,19,0.16); }

/* Contenu défilable dans les modales blanches (commande, profil) */
.modal-scroll-body { overflow-y: auto; max-height: 92vh; }

/* Product detail modal */
.prod-modal-img { width: 100%; height: 280px; object-fit: cover; display: block; }

/* Diaporama (photos/vidéos) du modal produit */
.prod-modal-slideshow { position: relative; width: 100%; height: 280px; overflow: hidden; background: #f5f5f7; }
.prod-modal-slideshow .slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.prod-modal-slideshow .slide.active { display: block; }
.prod-modal-slideshow .slide-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: rgba(17,17,19,0.4); color: #fff; font-size: 1rem;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  z-index: 2;
}
.prod-modal-slideshow .slide-nav.prev { left: 10px; }
.prod-modal-slideshow .slide-nav.next { right: 10px; }
.prod-modal-slideshow .slide-dots {
  position: absolute; bottom: 10px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px; z-index: 2;
}
.prod-modal-slideshow .slide-dot {
  width: 7px; height: 7px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.55); cursor: pointer; padding: 0;
}
.prod-modal-slideshow .slide-dot.active { background: #fff; }
.prod-modal-body { padding: 28px; overflow-y: auto; }
.prod-modal-title { font-size: 1.3rem; font-weight: 900; margin-bottom: 4px; letter-spacing: -0.02em; color: #111113; }
.prod-modal-desc { font-size: 0.875rem; color: #74777B; line-height: 1.7; margin-bottom: 18px; }
.prod-modal-price {
  font-size: 1.7rem; font-weight: 800;
  color: #111113;
  font-family: 'PT Mono', 'Courier New', monospace;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
}
.prod-modal-section { margin-bottom: 18px; }
.prod-modal-section label {
  display: block; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: #74777B; margin-bottom: 10px;
}

.sizes-grid { display: flex; gap: 7px; flex-wrap: wrap; }
.size-btn {
  min-width: 44px; padding: 8px 10px; text-align: center;
  border: 1.5px solid #E1E1E4; border-radius: 8px;
  background: white; font-size: 0.82rem; font-weight: 700;
  cursor: pointer; transition: all 0.15s; color: #242326;
  font-family: 'PT Mono', monospace;
}
.size-btn:hover { border-color: var(--accent); color: var(--accent); }
.size-btn.selected { background: #111113; border-color: #111113; color: white; }

.colors-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.color-btn {
  padding: 7px 16px; border: 1.5px solid #E1E1E4;
  border-radius: 999px; background: white;
  font-size: 0.82rem; font-weight: 700;
  cursor: pointer; transition: all 0.15s; color: #242326;
}
.color-btn:hover { border-color: var(--accent); }
.color-btn.selected { background: #111113; border-color: #111113; color: white; }

.qty-ctrl { display: flex; align-items: center; gap: 12px; }
.qty-btn {
  width: 38px; height: 38px;
  border: 1.5px solid #E1E1E4; border-radius: 50%;
  background: white; font-size: 1.1rem; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; color: #242326;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.qty-val { font-size: 1rem; font-weight: 800; min-width: 30px; text-align: center; }

/* ── Cart drawer ─────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(17,17,19,0.45);
  z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity 0.25s; backdrop-filter: blur(2px);
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed; top: 0; right: 0;
  width: 400px; max-width: 100vw; height: 100vh;
  background: white; z-index: 400;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  box-shadow: -8px 0 48px rgba(17,17,19,0.14);
}
.cart-drawer.open { transform: translateX(0); }

.cart-header {
  padding: 20px 24px;
  border-bottom: 1px solid #E1E1E4;
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.cart-header h3 { font-size: 1rem; font-weight: 900; flex: 1; letter-spacing: -0.01em; }
.cart-count-badge {
  background: #111113; color: white;
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
}
.cart-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-empty { text-align: center; padding: 60px 20px; color: #74777B; }
.cart-empty-icon { font-size: 2.5rem; margin-bottom: 14px; }
.cart-empty p { font-size: 0.875rem; line-height: 1.6; }

.cart-item {
  display: flex; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid #F7F7F8;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
  width: 60px; height: 60px;
  border-radius: 10px; object-fit: cover;
  flex-shrink: 0; background: #f5f3f6;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 800; font-size: 0.85rem; margin-bottom: 2px; color: #111113; }
.cart-item-meta { font-size: 0.72rem; color: #74777B; margin-bottom: 8px; }
.cart-item-controls { display: flex; align-items: center; gap: 8px; }
.cart-qty-btn {
  width: 26px; height: 26px;
  border: 1px solid #E1E1E4; border-radius: 6px;
  background: white; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: all 0.12s;
  display: flex; align-items: center; justify-content: center;
  color: #242326;
}
.cart-qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.cart-qty-val { font-size: 0.85rem; font-weight: 700; min-width: 22px; text-align: center; }
.cart-remove {
  margin-left: auto; background: none; border: none;
  color: #A0A0A5; cursor: pointer; font-size: 0.85rem;
  transition: color 0.15s; padding: 4px;
}
.cart-remove:hover { color: #ef4444; }
.cart-item-price {
  font-family: 'PT Mono', monospace;
  font-size: 0.85rem; font-weight: 700;
  color: #111113; white-space: nowrap;
}

.cart-footer {
  padding: 18px 24px;
  border-top: 1px solid #E1E1E4;
  flex-shrink: 0; background: #F7F7F8;
}
.cart-total-row {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 14px;
}
.cart-total-label { font-size: 0.875rem; color: #74777B; font-weight: 500; }
.cart-total-value {
  font-family: 'PT Mono', monospace;
  font-size: 1.3rem; font-weight: 800; color: #111113;
}

.drawer-close {
  width: 34px; height: 34px; border: none;
  background: #F7F7F8; border-radius: 8px; cursor: pointer;
  font-size: 0.9rem; display: flex;
  align-items: center; justify-content: center;
  color: #74777B; transition: all 0.15s;
}
.drawer-close:hover { background: #E1E1E4; color: #242326; }

/* ── Forms ───────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 0.72rem; font-weight: 700;
  color: #74777B; margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid #E1E1E4; border-radius: 10px;
  font-size: 0.9rem; font-family: inherit; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: #111113; background: white;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(247,82,147,0.1);
}
.form-group textarea { resize: vertical; min-height: 72px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Badges ──────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.69rem; font-weight: 700;
}
.badge-rose   { background: var(--accent-mist); color: var(--accent); }
.badge-green  { background: #dcfce7; color: #16a34a; }
.badge-red    { background: #fee2e2; color: #ef4444; }
.badge-gray   { background: #EFEFF1; color: #4A4A4D; border: 1px solid #E1E1E4; }

/* ── Toast ───────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: #111113; color: white;
  padding: 13px 18px; border-radius: 10px;
  font-size: 0.86rem; font-weight: 500;
  box-shadow: 0 6px 24px rgba(17,17,19,0.22);
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  min-width: 240px; max-width: 360px;
}
.toast.show { transform: translateX(0); }
.toast-icon {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; flex-shrink: 0;
}
.toast.success { border-left: 3px solid #22c55e; }
.toast.success .toast-icon { background: #22c55e; }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.error   .toast-icon { background: #ef4444; }
.toast.info    { border-left: 3px solid var(--accent); }
.toast.info    .toast-icon { background: var(--accent); }
.toast.warning { border-left: 3px solid #f59e0b; }
.toast.warning .toast-icon { background: #f59e0b; }

/* ── Responsive drawer ───────────────────────────── */
@media (max-width: 600px) {
  .cart-drawer { width: 100vw; }
  .form-row { grid-template-columns: 1fr; }
  .toast-container { bottom: 80px; right: 16px; left: 16px; }
  .toast { min-width: 0; }
}

/* Gradient text helper */
.gradient-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* size-check (filtres) */
.sizes-check-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.size-check-label { cursor: pointer; }
.size-check-label input { display: none; }
.size-check-btn {
  display: inline-block; min-width: 40px; padding: 5px 8px;
  text-align: center; border: 1.5px solid #E1E1E4; border-radius: 6px;
  font-size: 0.78rem; font-weight: 700; transition: all 0.15s;
  color: #4A4A4D; background: white;
  font-family: 'PT Mono', monospace;
}
.size-check-label input:checked + .size-check-btn {
  background: #111113; border-color: #111113; color: white;
}
.size-check-btn:hover { border-color: var(--accent); }
