/**
 * Variation picker — بديل مرئي لقوائم select الخاصة بالمنتجات المتغيّرة.
 * البناء: assets/js/variation-picker.js (يخفي .variations الأصلية ويبقيها مصدر القيمة).
 */

.variations, .single_variation { display: none !important; }

.vp { margin: var(--zolna-space-3) 0 var(--zolna-space-4); }
.vp__title { margin: var(--zolna-space-3) 0 var(--zolna-space-2); color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-title-small-size); font-weight: var(--md-sys-typescale-title-small-weight); }

.vp__options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--zolna-space-2); }
@media (min-width: 992px) { .vp__options { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.vp__option {
  display: flex;
  align-items: center;
  gap: var(--zolna-space-3);
  min-height: 48px;
  padding: var(--zolna-space-3);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface);
  cursor: pointer;
  user-select: none;
  transition: border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
              background-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}
.vp__option:hover { background: color-mix(in srgb, var(--md-sys-color-on-surface) 6%, var(--md-sys-color-surface)); }
.vp__option.is-selected { border-color: var(--md-sys-color-primary); background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); box-shadow: 0 0 0 1px var(--md-sys-color-primary); }
.vp__option.is-disabled { opacity: var(--md-sys-state-disabled-content-opacity); cursor: not-allowed; text-decoration: line-through; }

.vp__dot { position: relative; width: 20px; height: 20px; flex: none; border: 2px solid var(--md-sys-color-outline); border-radius: 50%; }
.vp__option.is-selected .vp__dot { border-color: var(--md-sys-color-primary); }
.vp__option.is-selected .vp__dot::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--md-sys-color-primary); }
.vp__label { font-size: var(--md-sys-typescale-label-large-size); font-weight: 700; }

/* بطاقة تفاصيل الاختيار */
.vp__card { margin-top: var(--zolna-space-4); border: 1px solid var(--md-sys-color-outline-variant); border-radius: var(--md-sys-shape-corner-large); overflow: hidden; background: var(--md-sys-color-surface-container-lowest); }
.vp__card-head { display: flex; align-items: center; justify-content: space-between; padding: var(--zolna-space-3) var(--zolna-space-4); border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.vp__card-title { font-size: var(--md-sys-typescale-title-small-size); font-weight: 700; }
.vp__card-body { padding: var(--zolna-space-3) var(--zolna-space-4); }
.vp__price { display: flex; align-items: center; justify-content: space-between; gap: var(--zolna-space-3); padding: var(--zolna-space-3) var(--zolna-space-4); border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.vp__price-k { font-size: var(--md-sys-typescale-label-large-size); font-weight: 700; }
.vp__price-v { font-size: var(--md-sys-typescale-title-medium-size); font-weight: 700; }
.vp__card-foot { display: flex; justify-content: flex-end; padding: var(--zolna-space-2) var(--zolna-space-4); border-top: 1px solid var(--md-sys-color-outline-variant); }
.vp__reset[hidden] { display: none; }

/* حقول أخفقت في التحقق قبل "اشتري الآن" */
.error { border: 2px solid var(--md-sys-color-error) !important; }
.vp ~ .error, select.error { outline: 2px solid var(--md-sys-color-error); }
