/* ============================================
   MODAL
   ============================================ */
.modal, .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,17,8,0.5);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  backdrop-filter: blur(3px);
}
.modal.open {
  opacity: 1;
  pointer-events: all;
}

/* Modal overlay shown with display:flex */
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"] {
  opacity: 1;
  pointer-events: all;
}
@media (min-width: 600px) {
  .modal { align-items: center }
}
.modal-box {
  background: var(--white);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(40px);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.modal.open .modal-box { transform: translateY(0) }
@media (min-width: 600px) {
  .modal-box {
    border-radius: var(--r-xl);
    transform: scale(0.95);
    max-height: 85vh;
  }
  .modal.open .modal-box { transform: scale(1) }
}
.modal-handle {
  width: 40px; height: 4px;
  background: var(--border-2);
  border-radius: 2px;
  margin: 12px auto 0;
}
@media (min-width: 600px) { .modal-handle { display:none } }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.modal-body {
  padding: 28px 32px;
  max-height: 60vh;
  overflow-y: auto;
}

/* Modal form spacing */
.modal-body .cust-form-group {
  margin-bottom: 22px;
}

.modal-body .cust-form-group:last-child {
  margin-bottom: 0;
}

/* Modal footer */
.modal-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-close {
  position: relative;
  top: 0; right: 0;
  width: 32px; height: 32px;
  background: transparent;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0;
  color: var(--gray-2);
  transition: var(--tr);
  z-index: 5;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--light); color: var(--maroon) }
/* × drawn as two crossed lines instead of the "×" glyph — font glyphs
   aren't optically centered within their own line box, which made the
   icon look off-center inside the circular button. */
.modal-close::before,
.modal-close::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.modal-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.modal-close::after { transform: translate(-50%, -50%) rotate(-45deg); }

/* Product Detail Modal */
#modal-product-detail .modal-box {
  max-width: 720px;
}
.prod-modal-gallery {
  position: relative;
  background: var(--light);
  aspect-ratio: 1.4;
  overflow: hidden;
}
.prod-modal-gallery img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.prod-modal-gallery-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 72px;
}
.prod-modal-body {
  padding: 24px;
}
.prod-modal-cat { font-size:11px; font-weight:700; color:var(--gold); text-transform:uppercase; letter-spacing:1px; margin-bottom:8px }
.prod-modal-name { font-size:22px; font-weight:800; color:var(--text); margin-bottom:14px; line-height:1.25 }
.prod-modal-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.prod-modal-price { font-size:28px; font-weight:800; color:var(--maroon) }
.prod-modal-ori { font-size:16px; color:var(--gray); text-decoration:line-through }
.prod-modal-disc {
  background: var(--green);
  color: white;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 100px;
}

/* Qty Selector */
.qty-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.qty-section-label { font-size:13px; font-weight:700; color:var(--text-2) }
.qty-big-ctrl { display:flex; align-items:center; gap:0; border:2px solid var(--border-2); border-radius:var(--r-sm) }
.qty-big-btn {
  width: 38px; height: 38px;
  display: flex; align-items:center; justify-content:center;
  font-size:18px; font-weight:700; line-height:38px;
  padding: 0; margin: 0;
  color: var(--maroon);
  transition: var(--tr);
}
.qty-big-btn:hover { background: var(--maroon-pale) }
.qty-big-val {
  width: 52px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  border-left: 2px solid var(--border);
  border-right: 2px solid var(--border);
  padding: 0; margin: 0;
}

/* Modal Action Buttons */
.prod-modal-actions { display:flex; gap:12px; margin-top:4px }
.btn-add-cart {
  flex: 1;
  background: var(--white);
  color: var(--maroon);
  font-size: 14px;
  font-weight: 800;
  padding: 13px;
  border-radius: var(--r);
  border: 2px solid var(--maroon);
  transition: var(--tr);
  text-align: center;
}
.btn-add-cart:hover { background: var(--maroon-pale) }
.btn-buy-now {
  flex: 1.5;
  background: var(--maroon);
  color: rgb(var(--maroon-fg-rgb));
  font-size: 14px;
  font-weight: 800;
  padding: 13px;
  border-radius: var(--r);
  transition: var(--tr);
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
}
.btn-buy-now:hover { background: var(--maroon-d); box-shadow: 0 4px 16px rgba(123,28,28,0.3) }

/* Desc Tab */
.prod-modal-desc {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.prod-modal-desc-title { font-size:13px; font-weight:700; color:var(--gray-2); margin-bottom:8px; text-transform:uppercase; letter-spacing:0.5px }
.prod-modal-desc-text { font-size:14px; color:var(--gray-2); line-height:1.7 }
