/* CSS Variables & Theme Setup */
:root {
  --primary-color: #ff6a00;
  --primary-hover: #e05d00;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-main: #111827;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --danger-color: #ef4444;
  --success-color: #22c55e;
  --radius: 10px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* Header */
.site-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.header-logo {
  height: 40px;
  object-fit: contain;
}

/* Main Layout */
.main-container {
  max-width: 1200px;
  width: 100%;
  margin: 20px auto;
  padding: 0 16px;
  flex: 1;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 992px) {
  .checkout-grid {
    grid-template-columns: 1.3fr 1fr;
  }
}

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
}

/* Status Cards (Lock / Empty / Error) */
.status-card {
  background: var(--card-bg);
  padding: 40px 20px;
  text-align: center;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 500px;
  margin: 40px auto;
}

.status-icon {
  margin-bottom: 16px;
  color: var(--text-muted);
}

.status-icon.text-danger {
  color: var(--danger-color);
}

.status-card h2 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.status-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

/* Cards Design */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

/* Product Item Cards */
.product-cards-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 576px) and (max-width: 991px) {
  .product-cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 16px;
  position: relative;
}

.product-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  background: #f1f5f9;
}

.product-details {
  flex: 1;
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  padding-right: 28px;
}

.product-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 6px;
}

.product-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-free-delivery {
  background: #dcfce7;
  color: #15803d;
}

.badge-variant {
  background: #f3f4f6;
  color: #374151;
}

.delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 4px;
  transition: color 0.2s;
}

.delete-btn:hover {
  color: var(--danger-color);
}

/* Checkout Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.required {
  color: var(--danger-color);
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  background: #fff;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary-color);
}

/* Promo Code */
.promo-input-group {
  display: flex;
  gap: 8px;
}

.promo-label {
  font-weight: 600;
}

.promo-message {
  font-size: 0.85rem;
  margin-top: 8px;
}

.promo-message.success {
  color: var(--success-color);
}

.promo-message.error {
  color: var(--danger-color);
}

/* Summary Lines */
.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.discount-line {
  color: var(--success-color);
}

.summary-divider {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 12px 0;
}

.total-line {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);

}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, opacity 0.2s;
  width: 100%;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #374151;
  color: #ffffff;
  width: auto;
  white-space: nowrap;
}

.btn-danger {
  background-color: var(--danger-color);
  color: #ffffff;
}

.btn-cancel {
  background-color: #e5e7eb;
  color: #374151;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loader Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.loader-content {
  text-align: center;
}

.loading-gif {
  width: 70px;
  height: 70px;
  margin-bottom: 12px;
}

/* Custom Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 16px;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.modal-card h3 {
  margin-bottom: 8px;
}

.modal-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions.vertical {
  flex-direction: column;
  gap: 10px;
}

.text-center {
  text-align: center;
}

.success-title {
  cursor: default;
  user-select: none;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.success-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1001;
  pointer-events: none;
}
/* Quantity Controller - Final Polish */
.quantity-controller {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin: 10px 0;
  background: #fff;
}

.btn-qty {
  width: 34px;
  height: 32px;
  border: none;
  background: #f9fafb;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
}

.btn-qty:hover:not(:disabled) {
  background: var(--primary-color);
  color: #fff;
}

.qty-value {
  width: 40px;
  text-align: center;
  font-weight: 700;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  line-height: 32px;
}
