/* ---- Cart Page ---- */
.cart-section { background: var(--dark); }
.cart-layout { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
.cart-items-section { min-width: 0; }
.cart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.cart-header h2 { font-family: var(--font-heading); font-size: 1.8rem; }
.clear-cart-btn { background: transparent; border: 1px solid rgba(255,68,68,0.4); color: #ff4444; padding: 8px 18px; border-radius: 50px; font-size: 0.85rem; font-weight: 600; transition: var(--transition); display: flex; align-items: center; gap: 6px; }
.clear-cart-btn:hover { background: #ff4444; color: #fff; border-color: #ff4444; }

.cart-item {
  display: grid; grid-template-columns: 90px 1fr auto auto;
  gap: 20px; align-items: center;
  background: var(--dark-3); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px;
  transition: var(--transition); animation: fadeInUp 0.3s ease;
}
.cart-item:hover { border-color: var(--primary); }
.cart-item-img { width: 90px; height: 90px; border-radius: var(--radius); overflow: hidden; }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info h4 { font-family: var(--font-heading); font-size: 1.1rem; margin-bottom: 4px; }
.cart-item-info p { color: var(--text-muted); font-size: 0.8rem; }
.cart-item-info .item-unit-price { color: var(--primary); font-size: 0.85rem; font-weight: 600; margin-top: 4px; }
.cart-item-qty { display: flex; align-items: center; gap: 12px; background: var(--dark-4); border-radius: 50px; padding: 6px 14px; }
.cart-item-qty button { width: 28px; height: 28px; border-radius: 50%; background: var(--dark-5); color: var(--white); font-size: 0.75rem; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.cart-item-qty button:hover { background: var(--primary); }
.cart-item-qty span { font-weight: 700; font-size: 1rem; min-width: 24px; text-align: center; }
.cart-item-total { text-align: right; }
.cart-item-total .item-total-price { font-size: 1.2rem; font-weight: 700; color: var(--primary); display: block; margin-bottom: 8px; }
.remove-item-btn { background: transparent; border: 1px solid rgba(255,68,68,0.3); color: #ff4444; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; transition: var(--transition); }
.remove-item-btn:hover { background: #ff4444; color: #fff; border-color: #ff4444; }

/* Empty Cart */
.empty-cart { text-align: center; padding: 100px 20px; }
.empty-cart-icon { font-size: 5rem; color: var(--primary); opacity: 0.3; margin-bottom: 24px; animation: float 3s ease infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
.empty-cart h2 { font-family: var(--font-heading); font-size: 2.5rem; margin-bottom: 12px; }
.empty-cart p { color: var(--text-muted); margin-bottom: 32px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* Cart Summary */
.cart-summary { position: sticky; top: 100px; background: var(--dark-3); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 28px; }
.cart-summary h3 { font-family: var(--font-heading); font-size: 1.5rem; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--glass-border); }

/* Delivery Mode & Radius Check Card */
.delivery-check-card {
  background: var(--dark-4);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 24px;
}
.delivery-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0,0,0,0.06);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.delivery-type-btn {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.25s ease;
  border: none;
  background: transparent;
  cursor: pointer;
}
.delivery-type-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(232, 130, 12, 0.3);
}

.delivery-location-box label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
}
.location-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
#delivery-area-select {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 9px 10px;
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 0.8rem;
  color: #222222;
  font-weight: 500;
  outline: none;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  transition: border-color 0.2s ease;
}
#delivery-area-select:focus {
  border-color: var(--primary);
}
.gps-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.gps-btn:hover {
  transform: scale(1.05);
}

.radius-status-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
}
.radius-status-banner.prompt {
  background: rgba(232, 130, 12, 0.1);
  color: #c46a08;
  border: 1px solid rgba(232, 130, 12, 0.3);
}
.radius-status-banner.eligible {
  background: rgba(76, 175, 80, 0.12);
  color: #2e7d32;
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.radius-status-banner.exceeded {
  background: rgba(244, 67, 54, 0.12);
  color: #c62828;
  border: 1px solid rgba(244, 67, 54, 0.3);
}
.radius-status-banner.pickup {
  background: rgba(33, 150, 243, 0.12);
  color: #1565c0;
  border: 1px solid rgba(33, 150, 243, 0.3);
}
/* Free Delivery Progress Banner */
.free-delivery-box {
  background: rgba(232, 130, 12, 0.08);
  border: 1px dashed rgba(232, 130, 12, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}
.free-delivery-box i {
  font-size: 1.1rem;
  color: var(--primary);
}
.free-delivery-box.unlocked {
  background: rgba(76, 175, 80, 0.12);
  border: 1px solid rgba(76, 175, 80, 0.4);
  color: #2e7d32;
}
.free-delivery-box.unlocked i {
  color: #2e7d32;
}

.summary-breakdown { margin-bottom: 24px; }
.breakdown-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 0.9rem; color: var(--text-muted); border-bottom: 1px solid var(--glass-border); }
.breakdown-row:last-child { border-bottom: none; }
.grand-total { font-size: 1.1rem; font-weight: 700; color: var(--white); padding-top: 14px; }
.grand-total span:last-child { color: var(--primary); font-size: 1.3rem; }
.text-green { color: #4caf50; font-weight: 600; }
.secure-badges { display: flex; justify-content: space-between; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--glass-border); }
.secure-badges span { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.secure-badges i { color: var(--primary); }

/* Checkout Customer Modal & Form */
.checkout-modal-box { text-align: left; max-width: 500px; width: 90%; background: var(--dark-3); border: 1px solid var(--glass-border); border-radius: 18px; padding: 28px; position: relative; }
.checkout-modal-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--glass-border); }
.checkout-modal-header i { font-size: 2rem; color: var(--primary); }
.checkout-modal-header h3 { font-family: var(--font-heading); font-size: 1.5rem; color: var(--white); margin: 0; }
.checkout-modal-header p { font-size: 0.8rem; color: var(--text-muted); margin: 2px 0 0 0; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--white); margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 14px; background: #ffffff; border: 1px solid var(--glass-border);
  border-radius: 8px; font-size: 0.88rem; color: #222222; outline: none; font-weight: 500; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--primary); }
.checkout-order-summary-mini {
  background: var(--dark-4); border: 1px solid var(--glass-border); border-radius: 10px; padding: 12px 16px; margin: 18px 0;
}
.mini-row { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.mini-row.grand { color: var(--white); font-size: 1rem; font-weight: 700; border-top: 1px solid var(--glass-border); padding-top: 6px; margin-top: 6px; }
.mini-row.grand strong { color: var(--primary); font-size: 1.15rem; }

@media (max-width: 1024px) { .cart-layout { grid-template-columns: 1fr; } .cart-summary { position: static; } }
@media (max-width: 640px) {
  .cart-item { grid-template-columns: 70px 1fr; grid-template-rows: auto auto; }
  .cart-item-qty { grid-column: 1 / -1; justify-content: center; }
  .cart-item-total { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
}
@media (max-width: 480px) {
  .cart-item-img { width: 60px; height: 60px; }
  .cart-item-name { font-size: 0.9rem; }
  .cart-item-price { font-size: 0.85rem; }
  .qty-btn { width: 28px; height: 28px; }
  .empty-cart { padding: 40px 20px; }
}

/* Checkout Success & Digital Receipt Card */
.checkout-success { text-align: center; }
.checkout-modal-box { max-width: 550px; width: 92%; transition: max-width 0.3s ease; }
.success-header { margin-bottom: 16px; }
.success-icon { font-size: 3.5rem; color: #4caf50; margin-bottom: 8px; animation: scaleIn 0.4s ease; }
@keyframes scaleIn { 0%{transform:scale(0);opacity:0} 100%{transform:scale(1);opacity:1} }
.checkout-success h2 { font-family: var(--font-heading); font-size: 1.7rem; color: var(--white); margin-bottom: 4px; }
.success-subtitle { font-size: 0.82rem; color: var(--text-muted); }

.order-receipt-card {
  background: var(--dark-4);
  border: 1px dashed var(--glass-border);
  border-radius: 14px;
  padding: 18px;
  text-align: left;
  margin: 16px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.receipt-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 12px;
}
.receipt-brand { font-size: 1.15rem; font-family: var(--font-heading); color: var(--white); display: flex; align-items: center; gap: 8px; }
.receipt-order-id-badge { background: rgba(232, 130, 12, 0.15); color: var(--primary); border: 1px solid rgba(232, 130, 12, 0.4); padding: 4px 10px; border-radius: 20px; font-weight: 700; font-size: 0.85rem; }

.receipt-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 14px; padding: 8px 12px; background: rgba(255,255,255,0.03); border-radius: 8px; }

.receipt-section-box { margin-bottom: 14px; }
.receipt-sec-title { font-size: 0.8rem; font-weight: 700; color: var(--white); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }

.receipt-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 0.82rem; color: var(--text-muted); background: var(--dark-3); padding: 10px 12px; border-radius: 8px; }
.receipt-info-grid strong { color: var(--white); }
.receipt-info-grid .r-full { grid-column: 1 / -1; }

.receipt-items-table { background: var(--dark-3); border-radius: 8px; padding: 10px 12px; max-height: 180px; overflow-y: auto; }
.receipt-item-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.82rem; }
.receipt-item-row:last-child { border-bottom: none; }
.r-item-left { display: flex; flex-direction: column; }
.r-item-name { color: var(--white); font-weight: 600; }
.r-item-unit { color: var(--text-muted); font-size: 0.75rem; }
.r-item-right { font-weight: 700; color: var(--primary); }

.receipt-summary-box { background: var(--dark-3); border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
.receipt-sum-row { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-muted); padding: 3px 0; }
.receipt-sum-row.grand { font-size: 0.95rem; font-weight: 700; color: var(--white); border-top: 1px solid var(--glass-border); padding-top: 8px; margin-top: 6px; }
.receipt-sum-row.grand strong { color: var(--primary); font-size: 1.15rem; }

.receipt-footer-note { text-align: center; margin-top: 12px; font-size: 0.75rem; color: var(--text-muted); }

.receipt-action-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; border-radius: 30px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; cursor: pointer; }
.btn-whatsapp { background: #25D366; color: #ffffff; border: none; font-weight: 600; transition: transform 0.2s ease, background 0.2s ease; }
.btn-whatsapp:hover { background: #1da851; color: #ffffff; transform: translateY(-2px); }

/* WhatsApp Order Confirmation Banner & Button */
.wa-order-placed-box {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.12), rgba(18, 140, 126, 0.18));
  border: 1.5px solid rgba(37, 211, 102, 0.45);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.15);
}
.wa-box-header {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin-bottom: 12px;
}
.wa-badge-pulse {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: #25D366;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  animation: waPulse 2s infinite;
}
@keyframes waPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
.wa-box-header h3 {
  font-size: 1.05rem;
  color: #ffffff;
  margin: 0 0 2px 0;
  font-family: var(--font-heading);
}
.wa-box-header p {
  font-size: 0.78rem;
  color: #d1fae5;
  margin: 0;
  line-height: 1.3;
}
.btn-whatsapp-order-now {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
}
.btn-whatsapp-order-now:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5);
  color: #ffffff;
}
.wa-hint-text {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.checkout-whatsapp-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #a7f3d0;
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 12px;
  text-align: center;
}
.checkout-whatsapp-badge i {
  color: #25D366;
  font-size: 1rem;
}

/* Optimized Print Stylesheet - Guaranteed 1-Page PDF Fit */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }
  html, body {
    height: auto !important;
    overflow: visible !important;
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Hide all main page content elements during print */
  #header-placeholder,
  #footer-placeholder,
  .page-hero,
  .cart-section,
  #page-loader,
  #scroll-progress,
  .mobile-overlay,
  .modal-close,
  .success-header,
  .receipt-action-btns,
  .wa-order-placed-box {
    display: none !important;
  }

  .modal {
    position: static !important;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    box-shadow: none !important;
  }
  .checkout-modal-box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
  }
  #checkout-form-step {
    display: none !important;
  }
  #checkout-success-step {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Receipt Card Styling for Print */
  #printable-order-receipt {
    position: static !important;
    display: block !important;
    width: 100% !important;
    max-width: 680px !important;
    margin: 0 auto !important;
    background: #ffffff !important;
    color: #111111 !important;
    border: 2px solid #222222 !important;
    border-radius: 8px !important;
    padding: 16px 20px !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  #printable-order-receipt * {
    color: #111111 !important;
    text-shadow: none !important;
  }
  #printable-order-receipt .receipt-top-bar {
    border-bottom: 2px solid #222222 !important;
    padding-bottom: 8px !important;
    margin-bottom: 10px !important;
  }
  #printable-order-receipt .receipt-brand {
    font-size: 1.3rem !important;
    color: #000000 !important;
  }
  #printable-order-receipt .receipt-brand strong,
  #printable-order-receipt .accent {
    color: #d97706 !important;
  }
  #printable-order-receipt .receipt-order-id-badge {
    background: #f3f4f6 !important;
    color: #111827 !important;
    border: 1px solid #111827 !important;
  }
  #printable-order-receipt .receipt-meta-grid {
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    padding: 6px 10px !important;
    margin-bottom: 10px !important;
  }
  #printable-order-receipt .receipt-sec-title {
    color: #111827 !important;
    font-size: 0.82rem !important;
    margin-bottom: 4px !important;
  }
  #printable-order-receipt .receipt-section-box {
    margin-bottom: 10px !important;
  }
  #printable-order-receipt .receipt-info-grid,
  #printable-order-receipt .receipt-items-table,
  #printable-order-receipt .receipt-summary-box {
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
  }
  #printable-order-receipt .receipt-info-grid strong,
  #printable-order-receipt .r-item-name,
  #printable-order-receipt .receipt-sum-row.grand {
    color: #000000 !important;
  }
  #printable-order-receipt .receipt-items-table {
    max-height: none !important;
    overflow: visible !important;
  }
  #printable-order-receipt .receipt-item-row {
    border-bottom: 1px dashed #d1d5db !important;
    padding: 4px 0 !important;
  }
  #printable-order-receipt .receipt-summary-box {
    margin-top: 8px !important;
  }
  #printable-order-receipt .receipt-footer-note {
    margin-top: 10px !important;
    font-size: 0.75rem !important;
    color: #4b5563 !important;
  }
}

