/* Beyya Traders — cart & checkout (Easa Arts style) */

.cart-box {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.125rem;
  background: var(--shop-orange, #f85606);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(248, 86, 6, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(248, 86, 6, 0.4);
}

#cartPopup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  z-index: 2000;
  width: 420px;
  max-width: 92%;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15);
  flex-direction: column;
  overflow: hidden;
}

#cartPopup.cart-popup--open {
  display: flex;
}

html.cart-popup-open,
body.cart-popup-open {
  overflow: hidden !important;
}

body.cart-popup-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

.cart-popup-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1999;
  background: rgba(15, 23, 42, 0.45);
}

.cart-popup-backdrop.is-visible {
  display: block;
}

.cart-items-scroll {
  overflow-y: auto;
  max-height: min(45vh, 380px);
  -webkit-overflow-scrolling: touch;
}

#popupCartItems {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cart-empty-msg {
  text-align: center;
  font-weight: 600;
  color: #64748b;
  margin: 0;
}

#popupCartItems li {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.cart-line-top {
  display: flex;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
}

.cart-item-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.cart-item-thumb--empty {
  display: inline-block;
  background: #f1f5f9;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
}

.cart-item-unit {
  font-size: 0.75rem;
  color: #64748b;
}

.cart-line-qty {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cart-qty-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f766e;
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.cart-qty-btn {
  width: 36px;
  height: 36px;
  border: 2px solid #0d9488;
  border-radius: 8px;
  background: #fff;
  color: #0d9488;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.cart-qty-btn--plus {
  background: #0d9488;
  color: #fff;
}

.cart-qty-val {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 700;
}

.cart-line-subtotal {
  margin-left: auto;
  font-weight: 700;
  color: var(--shop-orange);
  font-size: 0.875rem;
}

.cart-remove-btn {
  background: #fff;
  color: #e63946;
  border: 1px solid #fecaca;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

#popupCartTotal {
  font-weight: 700;
  color: var(--shop-orange);
  text-align: center;
  margin: 0.75rem 0;
  font-size: 1.125rem;
}

#checkoutForm label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #334155;
}

#checkoutForm input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
}

#checkoutCart,
#closeCart {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.25rem;
}

#checkoutCart {
  background: var(--shop-orange);
  color: #fff;
}

#closeCart {
  background: #f1f5f9;
  color: #334155;
}

#paymentPopup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  z-index: 2100;
  width: 420px;
  max-width: 92%;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
}

#paymentPopup h3 {
  margin-bottom: 1rem;
}

.bank-dl {
  margin: 0 0 1rem;
}

.bank-dl dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  margin-top: 0.5rem;
}

.bank-dl dd {
  margin: 0.125rem 0 0;
  font-weight: 600;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-btn {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
}

.order-ref {
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.payment-note {
  font-size: 0.8125rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.whatsapp-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.875rem;
  background: #25d366;
  color: #fff !important;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  margin-bottom: 0.5rem;
}

#closePaymentPopup {
  width: 100%;
  padding: 0.625rem;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.shop-card-actions {
  padding: 0 0.75rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shop-qty-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.shop-qty-btn {
  width: 32px;
  height: 32px;
  border: 2px solid var(--shop-orange);
  border-radius: 8px;
  background: #fff;
  color: var(--shop-orange);
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.shop-qty-btn--plus {
  background: var(--shop-orange);
  color: #fff;
}

.shop-qty-val {
  min-width: 1.25rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.9375rem;
}

.shop-add-btn {
  width: 100%;
}

.shop-card-link {
  pointer-events: none;
}

@media (max-width: 640px) {
  .cart-box {
    bottom: 1rem;
    right: 1rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }

  #cartPopup.cart-popup--open {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 90dvh;
  }

  #paymentPopup {
    max-height: 92dvh;
    overflow-y: auto;
  }
}
