/* Root Modal */
.buy-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 999999;
}

/* Overlay */
.buy-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 57, 39, 0.58);
  backdrop-filter: blur(4px);
}

/* Wrapper */
.buy-modal-wrapper {
  position: relative;
  margin: auto;
  width: min(100%, 580px);
  background: #FAF9F6;
  border-radius: 20px;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(212, 175, 55, 0.38);
  z-index: 2;
}

/* Sticky Emerald Top Header */
.buy-modal-header {
  background: #043927;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #D4AF37;
  flex-shrink: 0;
}

.buy-hdr-pill {
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid #D4AF37;
  color: #D4AF37;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.buy-modal-close {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: #FFFFFF;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.buy-modal-close:hover {
  background: rgba(212, 175, 55, 0.28);
}

/* Scrollable Middle Area */
.buy-modal-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

/* Compact Horizontal Product Header Bar */
.buy-product-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FFFFFF;
  border: 1px solid #EAE6DA;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.buy-product-bar img,
#m-img {
  width: 64px !important;
  height: 64px !important;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #EAE6DA;
  flex-shrink: 0;
  display: block;
}

.buy-reservation-bar {
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  color: #92400E;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.buy-product-meta {
  flex: 1;
  min-width: 0;
}

.buy-product-meta h4 {
  font-size: 14px;
  font-weight: 800;
  color: #043927;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buy-unit-price {
  font-size: 15px;
  font-weight: 800;
  color: #B45309;
  font-family: monospace;
}

.buy-qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FAF9F6;
  border: 1.5px solid #DCD9D0;
  border-radius: 10px;
  padding: 4px 8px;
  flex-shrink: 0;
}

.buy-qty-stepper button {
  background: #043927;
  color: #D4AF37;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.buy-qty-stepper span {
  min-width: 18px;
  text-align: center;
  font-family: monospace;
  font-weight: 800;
  font-size: 14px;
  color: #043927;
}

/* Bundle Tier Pills */
.buy-bundle-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.buy-bundle-pill {
  flex: 1;
  min-width: 150px;
  background: #FFFFFF;
  border: 1.5px solid #E5DEC9;
  border-radius: 10px;
  padding: 7px 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.buy-bundle-pill.active,
.buy-bundle-pill:hover {
  border-color: #D4AF37;
  background: #FFFDF5;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.18);
}

/* Form Grid */
.buy-form {
  padding: 0;
}

.buy-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 12px;
}

.buy-form .form-group {
  margin-bottom: 10px;
}

.buy-form label {
  font-size: 11.5px;
  font-weight: 700;
  color: #043927;
  margin-bottom: 4px;
  display: block;
}

.buy-form input,
.buy-form textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid #E2DFD5;
  font-size: 13px;
  background: #FFFFFF;
  color: #1F2937;
  margin-bottom: 0;
}

.buy-form input:focus,
.buy-form textarea:focus {
  outline: none;
  border-color: #043927;
}

/* Promo Accordion */
.buy-promo-accordion {
  background: #FFFFFF;
  border: 1px dashed #D4AF37;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.buy-promo-toggle {
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #043927;
  cursor: pointer;
}

/* Side-by-side Payment Selector Grid */
.aln-pay-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.aln-pay-option {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1.5px solid #E2DFD5;
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s ease;
  margin-bottom: 0 !important;
}

.aln-pay-option:hover,
.aln-pay-option.active {
  border-color: #043927;
  background: #F0FDF4;
}

.aln-pay-option input[type="radio"] {
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  accent-color: #043927;
}

.aln-pay-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #043927;
  flex: 1;
}

.aln-pay-pill {
  font-size: 9.5px;
  font-weight: 800;
  background: #D4AF37;
  color: #043927;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}

.aln-advance-box {
  background: #FFFFFF;
  border: 1.5px solid #04392735;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.aln-adv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: #043927;
}

.aln-adv-badge {
  font-size: 10px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 700;
}

.aln-adv-account {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #FAF9F6;
  border: 1px solid #EAE6DA;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.aln-adv-meta {
  font-size: 12px;
  color: #334155;
  line-height: 1.4;
}

.aln-copy-btn {
  background: #043927;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.aln-adv-instr {
  font-size: 11.5px !important;
  color: #475569 !important;
  margin: 0 0 8px 0 !important;
  line-height: 1.4;
}

/* Order Summary Box */
.order-summary {
  background: #FFFFFF;
  border: 1px solid #EAE6DA;
  border-radius: 12px;
  padding: 12px 14px;
}

.buy-sum-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: #4B5563;
  margin-bottom: 5px;
}

.buy-sum-total {
  display: flex;
  justify-content: space-between;
  border-top: 1px dashed #D4AF37;
  padding-top: 8px;
  margin-top: 6px;
  font-size: 15px;
  font-weight: 800;
  color: #043927;
}

/* Sticky Modal Footer CTA */
.buy-modal-footer {
  background: #FFFFFF;
  border-top: 1px solid #EAE6DA;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.buy-confirm {
  position: relative;
  overflow: hidden;
  padding: 11px 24px;
  border-radius: 12px;
  border: none;
  background: #043927;
  color: #D4AF37;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(4, 57, 39, 0.25);
  animation: alnPulseGlow 3.5s infinite;
  transition: all 0.2s ease;
}
.buy-confirm::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -120%;
  width: 60%;
  height: 200%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: rotate(25deg);
  animation: alnShimmer 3.5s infinite;
  pointer-events: none;
}
.buy-confirm:hover {
  opacity: 0.96;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.buy-whatsapp-pill {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #DCFCE7;
  border: 1px solid #86EFAC;
  color: #15803D !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  flex-shrink: 0;
}

/* Mobile Responsive Sheet */
@media (max-width: 600px) {
  .buy-modal {
    padding: 0;
    align-items: flex-end;
  }
  .buy-modal-wrapper {
    width: 100%;
    max-height: 94vh;
    border-radius: 18px 18px 0 0;
  }
  .buy-modal-scroll {
    padding: 14px 14px;
  }
  .buy-form-grid,
  .aln-pay-grid {
    grid-template-columns: 1fr;
  }
  .buy-modal-footer {
    padding: 10px 14px;
  }
  .buy-confirm {
    flex: 1;
    padding: 12px 14px;
  }
}
