/* 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; }
.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; display: flex; gap: 6px; z-index: 3; }
.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: 14px; 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-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; }

@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; }
}
