/* Serotonin PDM — product modal with inline checkout (paired with pdm-checkout.js).
   Wine/cream brand. The overlay (#productModal.product-modal-overlay.open) +
   .product-modal grid come from style.css; this styles the PDM contents. */

.product-modal { display: grid; grid-template-columns: 1fr 1fr; max-width: 1040px; width: 94vw; max-height: 90vh; overflow: hidden; background: #fff; border-radius: 24px; }
.product-modal .pm-gallery { position: relative; min-height: 100%; background: var(--light-gray, #ece7e0); }
.product-modal .pm-gal-main { position: absolute; inset: 0; background-size: cover; background-position: center; cursor: zoom-in; }
.product-modal .pm-gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: none; background: rgba(255,255,255,0.85); color: var(--wine, #4C1823); font-size: 18px; cursor: pointer; z-index: 3; display: flex; align-items: center; justify-content: center; }
.product-modal .pm-gallery-nav.prev { left: 12px; } .product-modal .pm-gallery-nav.next { right: 12px; }
.product-modal .pm-thumbs { position: absolute; bottom: 12px; left: 12px; right: auto; padding: 0; background: none; display: flex; gap: 6px; z-index: 3; } /* right/padding/gradient старого правила перебиты — «поехавшая тень» на фото */
.product-modal .pm-thumb { width: 46px; height: 46px; border-radius: 8px; border: 2px solid transparent; background-size: cover; background-position: center; cursor: pointer; padding: 0; }
.product-modal .pm-thumb.active { border-color: #fff; }

.pdm-info { position: relative; display: flex; flex-direction: column; min-height: 0; max-height: 90vh; }
.pdm-info .pm-close { position: absolute; top: 14px; right: 14px; z-index: 5; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(0,0,0,0.05); font-size: 20px; line-height: 1; color: #333; cursor: pointer; }
.pdm-scroll { flex: 1 1 auto; overflow-y: auto; padding: 30px 32px 16px; -webkit-overflow-scrolling: touch; }
.pdm-scroll .pm-name { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 500; color: var(--black, #1a1a1a); line-height: 1.2; margin: 0 38px 6px 0; }
.pdm-price-top { font-family: 'Playfair Display', serif; font-size: 22px; color: var(--wine, #4C1823); margin-bottom: 14px; }
.pdm-desc { font-size: 13.5px; line-height: 1.55; color: var(--warm-gray, #8a8079); margin: 0 0 16px; }
.pdm-more { background: none; border: none; color: var(--wine, #4C1823); font: inherit; font-weight: 600; cursor: pointer; padding: 0; border-bottom: 1px solid currentColor; }
.pdm-attrs { font-size: 12.5px; line-height: 1.6; color: var(--warm-gray, #8a8079); margin: -8px 0 16px; }

.pm-section-label, .pdm-group-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--warm-gray, #8a8079); margin: 0 0 9px; }
.pdm-group { margin-top: 20px; }

.pdm-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.pdm-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 78px; padding: 9px 14px; border: 1px solid var(--light-gray, #e2dcd4); border-radius: 12px; background: #fff; cursor: pointer; font-family: inherit; }
.pdm-opt.selected { border-color: var(--wine, #4C1823); background: rgba(76,24,35,0.04); }
.pdm-opt-label { font-size: 14px; font-weight: 600; color: var(--black, #1a1a1a); }
.pdm-opt-price { font-size: 11px; color: var(--warm-gray, #8a8079); }

.pdm-input { width: 100%; padding: 12px 14px; border: 1px solid var(--light-gray, #e2dcd4); border-radius: 12px; font-family: inherit; font-size: 16px; /* iOS авто-зум: <16px в поле → Safari зумит, чекаут уезжает */ color: var(--black, #1a1a1a); background: #faf8f5; outline: none; margin-bottom: 8px; box-sizing: border-box; }
.pdm-input:focus { border-color: var(--wine, #4C1823); }
textarea.pdm-input { resize: vertical; min-height: 56px; }
.pdm-phone { display: flex; gap: 8px; margin-bottom: 8px; }
.pdm-phone .pdm-input { margin-bottom: 0; }
.pdm-cc { flex: 0 0 auto; max-width: 104px; border: 1px solid var(--light-gray, #e2dcd4); border-radius: 12px; background: #faf8f5; font-family: inherit; font-size: 14px; padding: 0 8px; color: var(--black, #1a1a1a); }
.pdm-row2 { display: grid; grid-template-columns: 1fr; gap: 0; }

.pdm-toggle { display: flex; gap: 0; background: #f2ede7; border-radius: 12px; padding: 4px; margin-bottom: 10px; }
.pdm-tg { flex: 1; padding: 10px; border: none; background: none; border-radius: 9px; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--warm-gray, #8a8079); cursor: pointer; }
.pdm-tg.active { background: #fff; color: var(--wine, #4C1823); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

.pdm-zones { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.pdm-zone { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border: 1px solid var(--light-gray, #e2dcd4); border-radius: 12px; background: #fff; font-family: inherit; font-size: 13.5px; color: var(--black, #1a1a1a); cursor: pointer; }
.pdm-zone.selected { border-color: var(--wine, #4C1823); background: rgba(76,24,35,0.04); }
.pdm-zone-fee { font-weight: 600; color: var(--wine, #4C1823); font-size: 12.5px; }
.pdm-pickups { display: flex; flex-direction: column; gap: 6px; }
.pdm-pickup { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--light-gray, #e2dcd4); border-radius: 12px; cursor: pointer; font-size: 13.5px; }
.pdm-pickup.selected { border-color: var(--wine, #4C1823); background: rgba(76,24,35,0.04); }

.pdm-windows, .pdm-notify, .pdm-tips { display: flex; flex-wrap: wrap; gap: 6px; }
.pdm-win, .pdm-nb, .pdm-tip { padding: 9px 13px; border: 1px solid var(--light-gray, #e2dcd4); border-radius: 100px; background: #fff; font-family: inherit; font-size: 12.5px; color: var(--black, #1a1a1a); cursor: pointer; }
.pdm-win.selected, .pdm-nb.selected, .pdm-tip.selected { border-color: var(--wine, #4C1823); background: var(--wine, #4C1823); color: var(--cream, #F2F0EE); }
.pdm-win:disabled, .pdm-win-off { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }

.pdm-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--black, #1a1a1a); margin-bottom: 10px; cursor: pointer; }
.pdm-check input { width: 17px; height: 17px; accent-color: var(--wine, #4C1823); }

.pdm-extras { display: flex; flex-direction: column; gap: 6px; }
.pdm-extra-toggle { align-self: flex-start; background: none; border: none; color: var(--wine, #4C1823); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 4px 0; }

.pdm-upsell { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.pdm-upsell::-webkit-scrollbar { display: none; }
.pdm-up-card { flex: 0 0 116px; width: 116px; border: 1px solid var(--light-gray, #e2dcd4); border-radius: 12px; overflow: hidden; background: #fff; }
.pdm-up-img { width: 100%; aspect-ratio: 1/1; background-size: cover; background-position: center; background-color: #ece7e0; }
.pdm-up-name { font-size: 11.5px; line-height: 1.25; color: var(--black, #1a1a1a); padding: 6px 8px 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pdm-up-row { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 8px; }
.pdm-up-price { font-size: 11.5px; font-weight: 600; color: var(--wine, #4C1823); }
.pdm-up-add { width: 26px; height: 26px; border-radius: 50%; border: none; background: var(--wine, #4C1823); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.pdm-up-add.added { background: #6f7e5c; }

.pdm-summary { flex: 0 0 auto; border-top: 1px solid var(--light-gray, #e2dcd4); background: #fff; padding: 14px 32px 18px; }
.pdm-sum-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--warm-gray, #8a8079); margin-bottom: 4px; }
.pdm-sum-total { display: flex; justify-content: space-between; font-size: 17px; font-weight: 700; color: var(--black, #1a1a1a); margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--light-gray, #e2dcd4); }
.pdm-pay { width: 100%; margin-top: 12px; padding: 15px; border: none; border-radius: 100px; background: var(--wine, #4C1823); color: var(--cream, #F2F0EE); font-family: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0.3px; cursor: pointer; transition: background 0.2s; }
.pdm-pay:hover { background: var(--wine-light, #6a2735); }
.pdm-pay:disabled { opacity: 0.5; cursor: not-allowed; }
.pdm-err { color: #c0492b; font-size: 13px; margin-top: 8px; text-align: center; }

/* actions bar (viewer modal → shared cart checkout) */
.pdm-actions { flex: 0 0 auto; display: flex; gap: 10px; border-top: 1px solid var(--light-gray, #e2dcd4); background: #fff; padding: 14px 32px 18px; }
.pdm-act-cart, .pdm-act-buy { flex: 1; padding: 14px; border-radius: 100px; font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: 0.2px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.pdm-act-cart { background: #fff; border: 1px solid var(--wine, #4C1823); color: var(--wine, #4C1823); }
.pdm-act-cart.added { background: #6f7e5c; border-color: #6f7e5c; color: #fff; }
.pdm-act-buy { background: var(--wine, #4C1823); border: none; color: var(--cream, #F2F0EE); }
.pdm-act-buy:hover { background: var(--wine-light, #6a2735); }
@media (max-width: 768px) { .pdm-actions { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); } }

@media (max-width: 768px) {
  .product-modal { grid-template-columns: 1fr; width: 100vw; max-width: 100vw; height: 92vh; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .product-modal .pm-gallery { height: 32vh; min-height: 32vh; }
  .pdm-info { max-height: 60vh; }
  .pdm-scroll { padding: 22px 18px 14px; }
  .pdm-summary { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); }
  .pdm-scroll .pm-name { font-size: 21px; }
}

/* ---- fullscreen photo lightbox (tap the product photo) ---- */
.pdm-lightbox { position: fixed; inset: 0; z-index: 10000; display: none; align-items: center; justify-content: center; background: rgba(20,10,14,0.92); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.pdm-lightbox.open { display: flex; }
.pdm-lightbox .pdm-lb-img { width: min(92vw, 900px); height: min(86vh, 1100px); background-size: contain; background-position: center; background-repeat: no-repeat; }
.pdm-lightbox .pdm-lb-close { position: absolute; top: 18px; right: 20px; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255,255,255,0.14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.pdm-lightbox .pdm-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: none; background: rgba(255,255,255,0.14); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pdm-lightbox .pdm-lb-nav.prev { left: 16px; }
.pdm-lightbox .pdm-lb-nav.next { right: 16px; }
@media (max-width: 768px) {
  .pdm-lightbox .pdm-lb-nav { width: 42px; height: 42px; font-size: 24px; }
  .pdm-lightbox .pdm-lb-img { width: 94vw; height: 78vh; }
}

/* ── Shared cart engine: per-line quantity stepper, remove-confirm, image zoom ──
   Ported from UWF (themed to Serotonin wine palette). The shared cart.js emits
   these classes; without styling the stepper renders as raw browser buttons. */
.cart-qty { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cart-qty-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--sand, #E5DFD8); background: #fff; color: var(--wine, #4C1823); font-size: 17px; line-height: 1; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; padding: 0; cursor: pointer; }
.cart-qty-btn:active { background: var(--cream, #F2F0EE); }
.cart-qty-n { min-width: 16px; text-align: center; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600; }
.cart-item-zoom { cursor: zoom-in; }
.cart-qty-confirm { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.cart-qty-confirm-q { font-size: 11px; color: #9a8f88; }
.cart-qty-confirm-btns { display: inline-flex; gap: 12px; }
.cart-qty-confirm-btns button { border: none; background: none; padding: 2px 0; font-family: var(--font-body, sans-serif); font-size: 13px; font-weight: 600; cursor: pointer; }
.cart-rm-yes { color: #b3402f; }
.cart-rm-no { color: var(--wine, #4C1823); }
.cart-img-zoom { position: fixed; inset: 0; z-index: 10010; background: rgba(20,16,12,0.92); display: flex; align-items: center; justify-content: center; padding: 24px; }
.cart-img-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.cart-img-zoom-x { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255,255,255,0.18); color: #fff; font-size: 24px; cursor: pointer; }

/* iOS авто-зум: все поля чекаута/корзины ≥16px */
.cart-panel input, .cart-panel select, .cart-panel textarea, .pdm-cc, select.pdm-input, textarea.pdm-input { font-size: 16px; }

/* фикс 03.07 моб: крестик закрытия — на ФОТО (правый верх модалки), не у текста.
   .pdm-info теряет relative → absolute позиционируется от .product-modal
   (transform создаёт containing block). Белая подложка — читаем на фото. */
@media (max-width: 768px) {
  .pdm-info { position: static; }
  .pdm-info .pm-close {
    top: 12px; right: 12px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  }
}
