/* Product modal v2 — the purchase area is one shared scroll section.
   Gallery photos slide horizontally; product details always begin below it. */
#product-modal.modal{
  width:min(1180px,calc(100vw - 44px));
  max-height:calc(100dvh - 44px);
  margin:auto;
  padding:30px;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-color:#6c6c6c #101010;
}
#product-modal .modal-close{
  position:sticky;
  top:0;
  z-index:5;
  float:right;
  width:34px;
  height:34px;
  margin:-6px -6px 0 12px;
  background:#0a0a0a;
  line-height:30px;
}
#product-modal-content{clear:both}
.product-view{display:block}
.product-buying-layout{
  display:grid;
  grid-template-columns:minmax(0,1.18fr) minmax(340px,.82fr);
  align-items:start;
  gap:clamp(25px,4vw,54px);
}
.product-gallery{display:block!important;min-width:0;align-self:start}
.product-gallery-track{
  display:flex;
  width:100%;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  scroll-behavior:smooth;
  overscroll-behavior-x:contain;
  scrollbar-width:thin;
  scrollbar-color:#6c6c6c #111;
  background:#111;
}
.product-gallery-track::-webkit-scrollbar{height:8px}
.product-gallery-track::-webkit-scrollbar-track{background:#111}
.product-gallery-track::-webkit-scrollbar-thumb{background:#606060}
.product-gallery-slide{flex:0 0 100%;width:100%;margin:0;scroll-snap-align:start;background:#141414}
.product-gallery-slide img{display:block;width:100%;aspect-ratio:3/4;object-fit:cover;background:#151515}
.product-gallery-controls{display:grid;grid-template-columns:40px 1fr 40px;align-items:center;gap:10px;margin-top:11px}
.gallery-button{height:36px;border:1px solid #444;background:#101010;color:#ded9d8;font:500 18px/1 var(--mono);cursor:pointer;transition:background .2s,border-color .2s}
.gallery-button:hover{background:#4d191c;border-color:#9f3438}
.gallery-count{justify-self:center;color:#8e8988;font:500 9px var(--mono);letter-spacing:.22em}
.product-main{position:static!important;min-width:0;padding:6px 0 0}
.product-main .overline{margin-bottom:12px}
.product-main h2{max-width:560px;margin-bottom:15px}
.product-main .modal-price{margin:0 0 30px}
.product-description{max-width:470px;margin:0 0 35px}
.product-details{display:block;margin-top:48px;padding-top:45px;border-top:1px solid #2b2b2b}
.product-details header{max-width:720px;margin:0 auto 32px;text-align:center}
.product-details header .overline{margin-bottom:13px}
.detail-images{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.detail-images img{display:block;width:100%;height:auto;max-height:none;object-fit:contain;background:#111}
.detail-empty{margin:0;padding:50px 14px;border:1px dashed #333;color:#777;text-align:center;font:500 9px var(--mono);letter-spacing:.17em}

@media(max-width:780px){
  #product-modal.modal{width:calc(100vw - 18px);max-height:calc(100dvh - 18px);padding:20px 16px}
  #product-modal .modal-close{margin:-3px -2px 0 10px}
  .product-buying-layout{grid-template-columns:1fr;gap:27px}
  .product-main{padding:0}
  .product-main h2{font-size:clamp(42px,14vw,62px)}
  .product-main .modal-price{margin-bottom:22px}
  .product-description{margin-bottom:26px}
  .product-details{margin-top:36px;padding-top:33px}
  .detail-images{grid-template-columns:1fr}
}

@media(max-width:430px){
  #product-modal.modal{width:calc(100vw - 10px);max-height:calc(100dvh - 10px);padding:17px 13px}
  .product-gallery-controls{grid-template-columns:36px 1fr 36px}
  .gallery-button{height:34px}
  .sizes{gap:5px}
  .size-button{min-width:43px;height:37px}
  .add-row{gap:7px}
  .quantity-input{width:58px}
  .add-row .red-button{min-width:0;padding:0 12px;font-size:9px}
}
