/* Product detail: compact, centered and purchase-first. */
body.mvc-modal-open{
  overflow:hidden;
  overscroll-behavior:none;
}

#productModal.modal.open{
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:auto;
  padding:18px;
  overscroll-behavior:contain;
}

#productModal .modal-content{
  position:relative;
  width:min(1080px,100%);
  max-height:calc(100vh - 36px);
  margin:auto;
  padding:18px;
  gap:18px;
  overflow:hidden;
}

#productModal .m-close-floating{
  position:absolute;
  top:10px;
  right:10px;
  z-index:10;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  padding:0;
  border:1px solid rgba(18,32,51,.10);
  border-radius:50%;
  background:rgba(255,255,255,.94);
  color:#122033;
  box-shadow:0 10px 24px rgba(18,32,51,.14);
  font:700 1.45rem/1 "Work Sans",system-ui,sans-serif;
  cursor:pointer;
}

#productModal .m-close-floating:hover,
#productModal .m-close-floating:focus-visible{
  color:#0B6B54;
  border-color:rgba(14,143,110,.34);
  outline:none;
}

#productModal .m-img{height:min(48vh,470px)}
#productModal .modal-right{
  max-height:calc(100vh - 72px);
  overflow-y:auto;
  padding:4px 8px 4px 0;
  scrollbar-width:thin;
  overscroll-behavior:contain;
}

#productModal .m-name{font-size:clamp(1.75rem,2vw,2.5rem);line-height:1.08}
#productModal .m-price{font-size:1.65rem}
#productModal .m-desc{font-size:.92rem;line-height:1.55}
#productModal .m-value-card{padding:11px 12px;border-radius:15px}
#productModal .m-value-card strong{font-size:.84rem}
#productModal .m-value-card span{font-size:.75rem;line-height:1.4}
#productModal .m-section{padding:12px 14px;border-radius:18px}
#productModal .m-section-title{margin-bottom:8px}
#productModal .m-bullets ul{gap:7px}
#productModal .m-bullets li{padding:9px 12px 9px 38px;line-height:1.35}
#productModal .m-bullets li::before{top:7px}
#productModal .m-size-wrapper{padding:11px 14px}
#productModal .m-size-wrapper select{height:44px;padding:8px 12px}
#productModal .m-purchase-row{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  align-items:stretch;
}
#productModal .m-size-column,
#productModal .m-qty-column{min-width:0}
#productModal .m-size-wrapper,
#productModal .m-qty-column{
  box-sizing:border-box;
  min-height:96px;
  margin:0!important;
  padding:11px 14px;
  border:1px solid rgba(219,210,193,.84);
  border-radius:18px;
  background:#FBF8F3;
}
#productModal .m-size-wrapper{height:100%}
#productModal .m-qty-column{
  display:grid;
  align-content:center;
  gap:6px;
}
#productModal .m-qty-label{display:block;color:#65716f}
#productModal .qty-ctrl{
  width:100%;
  box-sizing:border-box;
  justify-content:space-between;
  margin-bottom:0!important;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
}
#productModal .qty-ctrl .btn{min-width:44px;min-height:44px;padding:8px}
#productModal .qty-ctrl #mQty{
  width:54px!important;
  padding:8px 4px!important;
  appearance:textfield;
  -moz-appearance:textfield;
}
#productModal .qty-ctrl #mQty::-webkit-outer-spin-button,
#productModal .qty-ctrl #mQty::-webkit-inner-spin-button{
  margin:0;
  -webkit-appearance:none;
}
#productModal .m-actions{gap:8px!important}
#productModal .m-actions .btn{
  min-height:48px;
  padding:10px 14px;
  font-size:.86rem;
  letter-spacing:.04em;
}
#productModal #mClose{display:none!important}
#productModal .m-assurance{padding:11px 14px}
#productModal .m-assurance p{font-size:.8rem;line-height:1.4;margin-bottom:5px}

@media (min-width:769px) and (max-height:850px){
  #productModal .m-img{height:min(42vh,360px)}
  #productModal .m-value-card span{display:none}
  #productModal .m-assurance{display:none}
}

/* En laptops de poca altura, prioriza selección y compra sobre copy promocional. */
@media (min-width:769px) and (max-height:780px){
  #productModal .modal-right{gap:8px}
  #productModal .m-desc,
  #productModal .m-value-strip{display:none}
  #productModal .m-section{padding:9px 11px}
  #productModal .m-section-title{margin-bottom:6px}
  #productModal .m-bullets ul{gap:5px}
  #productModal .m-bullets li{padding:7px 10px 7px 34px}
  #productModal .m-bullets li::before{left:9px;top:5px}
  #productModal .m-size-wrapper,
  #productModal .m-qty-column{min-height:88px;padding:9px 11px}
  #productModal .m-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
  #productModal #mBuy{grid-column:span 2}
}

@media (max-width:768px){
  #productModal.modal.open{align-items:flex-start;padding:8px}
  #productModal .modal-content{max-height:none;margin:0;padding:12px;overflow:visible}
  #productModal .m-close-floating{position:sticky;margin:0 0 -42px auto}
  #productModal .modal-right{max-height:none;overflow:visible;padding:0}
  #productModal .m-img{height:min(42vh,360px)}
  #productModal .m-value-strip{grid-template-columns:1fr 1fr}
  #productModal .m-value-card:last-child{grid-column:1/-1}
  #productModal .m-purchase-row{grid-template-columns:1fr}
  #productModal .m-actions{grid-template-columns:1fr 1fr}
  #productModal #mBuy{grid-column:1/-1}
}
