/* ============================================================
   انتخاب سایز و رنگ در صفحه‌ی محصول — partials/variant-picker.php
   ماژول مستقل: حذف این فایل فقط ظاهر را ساده می‌کند و خرید را خراب نمی‌کند.
   ============================================================ */
.vp-group { display: grid; gap: 10px; min-width: 0; }
.vp-head { display: flex; align-items: baseline; gap: 6px; font-size: 13.5px; line-height: 1.6; }
.vp-label { color: var(--muted); font-weight: 700; }
.vp-label::after { content: ':'; }
.vp-current { color: var(--ink); font-weight: 700; }
.vp-options { display: flex; flex-wrap: wrap; align-items: flex-start; }

/* ورودی رادیویی پنهان اما قابل دسترس با صفحه‌کلید */
.vp-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }

/* ---------- چیپ‌های سایز (و رنگ بدون نمونه) ---------- */
.vp-chips { gap: 8px; }
.vp-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .2px;
  cursor: pointer;
  user-select: none;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.vp-chip:hover { border-color: #9aa7b9; }
.vp-chip:has(.vp-input:checked) {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(7, 26, 51, .16);
}
.vp-chip:has(.vp-input:focus-visible) { outline: 2px solid var(--logo-gold, #ddb052); outline-offset: 2px; }
.vp-chip.is-out { color: #9aa3b2; border-style: dashed; background: #fafbfc; }
.vp-chip.is-out .vp-chip-text { text-decoration: line-through; text-decoration-color: rgba(102, 112, 133, .55); }
.vp-chip.is-out:has(.vp-input:checked) { background: #eef1f5; color: var(--muted); border-color: #9aa3b2; border-style: solid; box-shadow: none; }
.vp-chip.is-pre::after { content: ''; position: absolute; top: 3px; inset-inline-end: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--logo-gold, #ddb052); }

/* ---------- نمونه‌ی رنگ (پالت یا تصویر کوچک) با نام زیر آن ---------- */
.vp-swatches { gap: 12px 10px; }
.vp-swatch {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  width: 58px;
  padding: 2px 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.vp-dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--sw, #f1f3f6);
  box-shadow: inset 0 0 0 1px rgba(7, 26, 51, .1), 0 0 0 0 transparent;
  transition: transform .18s ease, box-shadow .18s ease;
}
.vp-shape-rounded .vp-dot { border-radius: 11px; }
.vp-dot img { width: 100%; height: 100%; object-fit: cover; }
.vp-dot-empty { color: var(--muted); font-size: 14px; font-weight: 700; }
.vp-swatch.is-light .vp-dot { box-shadow: inset 0 0 0 1px rgba(7, 26, 51, .22), 0 0 0 0 transparent; }
.vp-swatch:hover .vp-dot { transform: scale(1.06); }
.vp-swatch:has(.vp-input:checked) .vp-dot { box-shadow: inset 0 0 0 1px rgba(7, 26, 51, .12), 0 0 0 2px #fff, 0 0 0 3.5px var(--brand); }
.vp-swatch:has(.vp-input:focus-visible) .vp-dot { outline: 2px solid var(--logo-gold, #ddb052); outline-offset: 5px; }
.vp-name {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.vp-swatch:has(.vp-input:checked) .vp-name { color: var(--ink); font-weight: 700; }
.vp-no-names { gap: 10px; }
.vp-no-names .vp-swatch { width: auto; }
/* رنگ ناموجود برای سایز انتخاب‌شده: خط مورب روی نمونه */
.vp-swatch.is-out .vp-dot { opacity: .45; }
.vp-swatch.is-out .vp-dot::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top left, transparent calc(50% - 1px), rgba(7, 26, 51, .7) 50%, transparent calc(50% + 1px)); }
.vp-swatch.is-out .vp-name { text-decoration: line-through; }
.vp-swatch.is-pre .vp-dot + .vp-name::after { content: ' •'; color: var(--logo-gold, #ddb052); }

/* نوع لباس: همان فهرست کشویی، جمع‌وجور و هم‌اندازه با چیپ‌ها */
.vp-select { display: grid; gap: 8px; justify-items: start; color: var(--muted); font-size: 13.5px; font-weight: 700; }
.vp-select select {
  width: auto;
  min-width: 150px;
  max-width: 100%;
  height: 38px;
  min-height: 0;
  padding: 0 14px 0 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23071a33' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat left 13px center;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  box-shadow: none;
}
.vp-select select:hover { border-color: #9aa7b9; }
.vp-select select:focus-visible { outline: 2px solid var(--logo-gold, #ddb052); outline-offset: 2px; }

@media (max-width: 520px) {
  .vp-swatch { width: 54px; }
  .vp-dot { width: 36px; height: 36px; }
  .vp-chip { min-width: 44px; height: 35px; padding: 0 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .vp-chip, .vp-dot { transition: none; }
  .vp-swatch:hover .vp-dot { transform: none; }
}
