/**
 * Product variation selector (chips/swatches) + "Please select a
 * variation" modal — styles used by public/js/product-variations.js.
 *
 * Split into its own file (rather than an inline <style> block) so it
 * loads and caches like any other static asset, independent of the
 * PHP page around it.
 */

.pd-variations { margin-bottom: 20px; }
.pd-variation-group { margin-bottom: 16px; }
.pd-variation-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-700);
  margin-bottom: 8px;
}
.pd-variation-selected-value { font-weight: 400; color: var(--gray-500); }
.pd-variation-options { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-variation-chip {
  padding: 8px 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s ease;
}
.pd-variation-chip:hover { border-color: var(--green-500, #4caf50); }
.pd-variation-chip.pd-variation-selected {
  border-color: var(--green-700);
  background: var(--green-50);
  color: var(--green-800);
  font-weight: 600;
}
.pd-variation-chip.pd-variation-unavailable {
  opacity: 0.4;
  text-decoration: line-through;
  cursor: not-allowed;
}
.pd-variation-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}
.pd-variation-swatch:hover { border-color: var(--gray-500); }
.pd-variation-swatch.pd-variation-selected {
  border-color: var(--green-700);
  box-shadow: 0 0 0 2px var(--green-50), 0 0 0 3.5px var(--green-700);
}
.pd-variation-swatch.pd-variation-unavailable { opacity: 0.35; cursor: not-allowed; }

/* ── "Please select a variation" modal (Jumia-style) ───────── */
.pd-vmodal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 10050;
  align-items: flex-end;
  justify-content: center;
}
.pd-vmodal-overlay.open { display: flex; }
.pd-vmodal {
  background: #fff;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  animation: pdVmodalUp .25s ease;
}
@media (min-width: 640px) {
  .pd-vmodal-overlay { align-items: center; }
  .pd-vmodal { border-radius: 14px; margin: 20px; max-height: 82vh; }
}
@keyframes pdVmodalUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.pd-vmodal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}
.pd-vmodal-head h3 { margin: 0; font-size: 1.05rem; color: var(--gray-900); }
.pd-vmodal-close {
  background: var(--gray-100);
  border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--gray-600);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pd-vmodal-body { overflow-y: auto; padding: 4px 20px; flex: 1; }
.pd-vmodal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-100);
}
.pd-vmodal-row:last-child { border-bottom: none; }
.pd-vmodal-row.pd-vmodal-row-oos { opacity: .55; }
.pd-vmodal-row-info { min-width: 0; }
.pd-vmodal-row-label { font-weight: 600; font-size: 0.95rem; color: var(--gray-900); margin-bottom: 3px; }
.pd-vmodal-row-price { font-size: 0.9rem; color: var(--gray-800); }
.pd-vmodal-row-price .pd-vmodal-strike { color: var(--gray-400); text-decoration: line-through; margin-left: 6px; font-size: 0.82rem; }
.pd-vmodal-row-stock { font-size: 0.76rem; margin-top: 3px; }
.pd-vmodal-row-stock.low  { color: #d32f2f; }
.pd-vmodal-row-stock.few  { color: #c77700; }
.pd-vmodal-row-stock.oos  { color: var(--gray-500); }
.pd-vmodal-stepper {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--gray-300);
  border-radius: 10px;
  overflow: hidden;
  height: 38px;
  flex-shrink: 0;
  background: #fff;
}
.pd-vmodal-stepper button {
  width: 36px; height: 100%;
  background: var(--gray-100);
  border: none;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-800);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.pd-vmodal-stepper button:disabled { opacity: .4; cursor: not-allowed; }
.pd-vmodal-stepper .pd-vmodal-qty-val {
  min-width: 34px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-900);
  border-left: 2px solid var(--gray-200);
  border-right: 2px solid var(--gray-200);
  height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.pd-vmodal-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--gray-100);
  flex-shrink: 0;
}
.pd-vmodal-actions button {
  flex: 1;
  padding: 13px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1.5px solid var(--gray-300);
}
.pd-vmodal-continue { background: #fff; color: var(--gray-800); }
.pd-vmodal-continue:hover { background: var(--gray-50); }
.pd-vmodal-gotocart { background: var(--gray-300); color: #fff; border-color: var(--gray-300); }
.pd-vmodal-gotocart:not(:disabled) { background: var(--green-700); border-color: var(--green-700); }
.pd-vmodal-gotocart:disabled { cursor: not-allowed; }
