/* Product configurator: AMORE's dialog geometry with live WooCommerce choices. */
#s2o-product-dialog[hidden] { display: none !important; }

.s2o-product-modal { min-height: min(560px, calc(100dvh - 48px)); }
.s2o-product-modal .config-art { overflow: hidden; }
.s2o-product-modal .config-art-photo,
.s2o-product-modal .config-art-photo .image-slot { min-width: 0; min-height: 0; }
.s2o-product-modal .config-art-photo .image-slot { width: 100%; }
.s2o-product-modal .config-art-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.s2o-product-modal .config-art-photo .image-slot:hover img { transform: none; }
.s2o-product-modal .dialog-heading [hidden] { display: none; }
.s2o-product-modal .dialog-heading h2 { overflow-wrap: anywhere; }
.s2o-product-modal .dialog-body { flex: 1 1 auto; min-height: 0; scrollbar-gutter: stable; }
.s2o-product-modal .dialog-body .config-group-title:first-child { margin-top: 10px; }
.s2o-product-modal .config-group-title { line-height: 1.35; }
.s2o-product-modal .config-group-sub { line-height: 1.5; }
.s2o-product-modal .option-row { width: 100%; text-align: left; }
.s2o-product-modal .option-row.selected,
.s2o-product-modal .option-row:has(input:checked) { background: var(--red-soft); border-color: #e5b5a6; }
.s2o-product-modal .option-row:focus-within { outline: 2px solid var(--red); outline-offset: 2px; }
.s2o-product-modal .option-row input[type="number"] { width: 58px; min-width: 58px; max-width: 58px; min-height: 38px; padding: 3px; border: 1px solid var(--border); border-radius: 6px; background: var(--paper); color: var(--ink); text-align: center; }
.s2o-product-modal .option-name { line-height: 1.4; }
.s2o-product-modal .option-row strong { margin-left: auto; color: var(--ink); }
.s2o-product-modal .s2o-quantity-choice { gap: 0; padding: 0; overflow: hidden; cursor: default; }
.s2o-product-modal .s2o-quantity-choice button { font: inherit; color: inherit; cursor: pointer; }
.s2o-product-modal .s2o-option-add { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; min-height: 55px; padding: 11px 15px; border: 0; background: transparent; text-align: left; }
.s2o-product-modal .s2o-option-add:disabled { opacity: .48; cursor: default; }
.s2o-product-modal .s2o-option-remove { flex: none; width: 43px; align-self: stretch; border: 0; border-right: 1px solid var(--border); background: transparent; font-size: 20px; }
.s2o-product-modal .s2o-option-count { flex: none; min-width: 27px; text-align: center; font-weight: 700; }
.s2o-product-modal .s2o-quantity-choice button:focus-visible { outline: 2px solid var(--red); outline-offset: -3px; }
.s2o-product-modal .s2o-quantity-choice [hidden] { display: none; }
.s2o-product-modal .dialog-footer { position: relative; z-index: 1; }
.s2o-product-modal .s2o-config-error:not([hidden]) { margin: 0 0 10px; color: var(--red); font-size: 12px; line-height: 1.4; }
.s2o-product-modal .qty { flex: none; }
.s2o-product-modal .qty button:disabled { color: var(--muted); opacity: .45; cursor: default; }
.s2o-product-modal [data-s2o-add] { white-space: normal; line-height: 1.2; text-align: center; }

@media (max-width: 700px) {
  #s2o-product-dialog { align-items: flex-end; padding: 0; }
  .s2o-product-modal { width: 100%; height: 94dvh; max-height: 94dvh; min-height: 0; display: flex; flex-direction: column; border-radius: 23px 23px 0 0; }
  .s2o-product-modal > .config-art { height: clamp(120px, 19dvh, 170px); min-height: 0; flex: none; padding: 0 !important; }
  .s2o-product-modal .config-art-photo,
  .s2o-product-modal .config-art-photo .image-slot { width: 100%; height: 100%; aspect-ratio: auto !important; border-radius: 0; }
  .s2o-product-modal .config-col { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; max-height: none; }
  .s2o-product-modal .dialog-heading { flex: none; padding: 14px 21px 9px; }
  .s2o-product-modal .dialog-heading h2 { margin: 6px 37px 4px 0; font-size: clamp(35px, 9vw, 38px); }
  .s2o-product-modal .dialog-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 20px 12px !important; scrollbar-gutter: auto; -webkit-overflow-scrolling: touch; }
  .s2o-product-modal .dialog-footer { flex: none; padding: 11px 17px calc(12px + env(safe-area-inset-bottom)); background: var(--paper); box-shadow: 0 -8px 30px rgba(34,24,17,.04); }
  .s2o-product-modal .config-footer-line { gap: 9px; }
  .s2o-product-modal .config-footer-line .qty { min-height: 52px; }
  .s2o-product-modal .config-footer-line .btn { min-height: 52px; min-width: 0; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .s2o-product-modal,
  .s2o-product-modal .option-row { animation: none !important; transition: none !important; }
}
