/* ===================================================================
   CART PAGE — Premium Mobile-First Medical Commerce v5.0
   Rebuilt for excellent mobile UX
   =================================================================== */

/* === CSS Variables (fallbacks if pharma-components not loaded) === */
:root {
  --cart-brand: #0d7a4a;
  --cart-brand-hover: #0a6340;
  --cart-brand-light: hsla(160, 84%, 30%, 0.08);
  --cart-danger: #e53e3e;
  --cart-danger-light: hsla(0, 72%, 51%, 0.08);
  --cart-success: #38a169;
  --cart-success-light: hsla(152, 68%, 38%, 0.08);
  --cart-radius: 16px;
  --cart-radius-sm: 10px;
  --cart-radius-pill: 50px;
  --cart-shadow: 0 2px 12px rgba(0,0,0,0.06);
  --cart-shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --cart-transition: 0.2s ease;
}

/* === Page Foundation === */
body.cart-page {
  background: linear-gradient(160deg, hsl(160, 40%, 92%) 0%, hsl(160, 40%, 92%) 40%, hsl(35, 18%, 90%) 100%);
  color: var(--pw-text, #1a1a2e);
  min-height: 100vh;
}

.cart-container {
  padding-bottom: 2rem;
}
.cart-container .container,
.cart-main-content {
  max-width: 1200px;
  padding-left: 16px;
  padding-right: 16px;
}

.cart-main-content {
  margin: 0 auto;
  padding-top: 8px;
}

/* === Breadcrumb === */
.cart-breadcrumb {
  padding: 12px 0 4px;
}
.cart-breadcrumb nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  flex-wrap: wrap;
}
.cart-breadcrumb a {
  color: var(--pw-text-3, #6b7280);
  text-decoration: none;
  transition: color var(--cart-transition);
}
.cart-breadcrumb a:hover { color: var(--pw-brand, var(--cart-brand)); }
.cart-breadcrumb .separator { color: var(--pw-text-4, #9ca3af); font-size: 0.65rem; }
.cart-breadcrumb .current { color: var(--pw-text, #1a1a2e); font-weight: 600; }

/* === Cart Header === */
.cart-header {
  padding: 20px 0 12px;
}
.cart-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cart-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--pw-text, #1a1a2e);
  margin: 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-title-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pw-brand-light, var(--cart-brand-light));
  border-radius: var(--cart-radius-sm);
  color: var(--pw-brand, var(--cart-brand));
  font-size: 1rem;
  flex-shrink: 0;
}
.cart-subtitle {
  color: var(--pw-text-3, #6b7280);
  margin: 4px 0 0;
  font-size: 0.85rem;
}
.cart-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--pw-surface, #fff);
  border: 1px solid var(--pw-border, #e5e7eb);
  border-radius: var(--cart-radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pw-text-2, #374151);
  white-space: nowrap;
}
.cart-count-badge i { color: var(--pw-brand, var(--cart-brand)); }

/* === Progress Steps === */
.cart-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 16px 0 24px;
}
.cart-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--pw-text-4, #9ca3af);
  white-space: nowrap;
}
.cart-step.active { color: var(--pw-text, #1a1a2e); font-weight: 700; }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--pw-bg-alt, #f3f4f6);
  border: 1.5px solid var(--pw-border, #e5e7eb);
  transition: all var(--cart-transition);
}
.cart-step.active .step-num {
  background: var(--pw-brand, var(--cart-brand));
  color: #fff;
  border-color: var(--pw-brand, var(--cart-brand));
  box-shadow: 0 0 0 4px hsla(160, 84%, 30%, 0.15);
}
.step-line {
  width: 36px;
  height: 2px;
  background: var(--pw-border, #e5e7eb);
  margin: 0 6px;
  flex-shrink: 0;
  border-radius: 1px;
}
.step-line.completed { background: var(--pw-success, var(--cart-success)); }

/* =============================================
   CART ITEMS SECTION
   ============================================= */
.cart-items-section {
  background: var(--pw-surface, #fff);
  border: 1px solid hsl(160, 40%, 92%);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 140, 105, 0.08);
}

.cart-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--pw-border, #e5e7eb);
}
.cart-items-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pw-text, #1a1a2e);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-items-header h2 i {
  color: var(--pw-brand, var(--cart-brand));
  font-size: 0.85rem;
}
.items-count {
  background: var(--pw-brand-light, var(--cart-brand-light));
  color: var(--pw-brand, var(--cart-brand));
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--cart-radius-pill);
}

/* === Individual Cart Item === */
.cart-items-list { padding: 0; }

.cart-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--pw-border, #e5e7eb);
  position: relative;
  transition: background var(--cart-transition);
}
.cart-item:last-child { border-bottom: none; }
.cart-item:hover { background: hsla(210, 20%, 98%, 0.5); }

/* Item Image */
.cart-item-image {
  width: 64px;
  height: 64px;
  border-radius: var(--cart-radius-sm);
  overflow: hidden;
  background: var(--pw-bg-alt, #f3f4f6);
  border: 1px solid var(--pw-border, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cart-item-image .placeholder-icon {
  color: var(--pw-text-4, #9ca3af);
  font-size: 1.2rem;
}

/* Item Info */
.cart-item-info {
  flex: 1;
  min-width: 0;
  padding-left: 0;
}
.cart-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pw-text, #1a1a2e);
  margin: 0 0 2px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-item-code {
  font-size: 0.7rem;
  color: var(--pw-text-4, #9ca3af);
  margin: 0 0 4px 0;
  font-variant-numeric: tabular-nums;
}
.cart-item-unit-price {
  font-size: 0.8rem;
  color: var(--pw-text-3, #6b7280);
  font-weight: 500;
}

/* Quantity Stepper */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--pw-bg-alt, #f3f4f6);
  border: 1px solid var(--pw-border, #e5e7eb);
  border-radius: var(--cart-radius-sm);
  overflow: hidden;
  transition: border-color var(--cart-transition);
}
.qty-stepper:focus-within {
  border-color: var(--pw-brand, var(--cart-brand));
  box-shadow: 0 0 0 3px hsla(160, 84%, 30%, 0.1);
}
.qty-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  /* Brand-colored, heavier icons — the old thin grey +/- were hard to see */
  color: var(--pw-brand, var(--cart-brand));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  transition: background var(--cart-transition), color var(--cart-transition);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.qty-btn:hover {
  background: var(--pw-brand, var(--cart-brand));
  color: #fff;
}
.qty-btn:active { transform: scale(0.92); }
.cart-quantity {
  width: 44px;
  text-align: center;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--pw-text, #1a1a2e);
  -moz-appearance: textfield;
  appearance: textfield;
}
.cart-quantity::-webkit-outer-spin-button,
.cart-quantity::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Subtotal */
.cart-item-subtotal {
  text-align: end;
  min-width: 80px;
}
.subtotal-label {
  display: block;
  font-size: 0.65rem;
  color: var(--pw-text-4, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}
.subtotal-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--pw-text, #1a1a2e);
  font-variant-numeric: tabular-nums;
}
.subtotal-currency {
  font-size: 0.7rem;
  color: var(--pw-text-3, #6b7280);
}

/* Remove Button */
.cart-item-remove {
  width: 44px;
  height: 44px;
  border: none;
  /* Visible by default (was an almost-invisible grey icon with no affordance) */
  background: var(--pw-danger-light, var(--cart-danger-light));
  color: var(--pw-danger, var(--cart-danger));
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background var(--cart-transition), color var(--cart-transition), transform var(--cart-transition);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.cart-item-remove:hover {
  background: var(--pw-danger, var(--cart-danger));
  color: #fff;
  transform: translateY(-1px);
}
.cart-item-remove:active { transform: scale(0.92); }

/* Remove animation (AJAX instant delete) */
.cart-item.removing,
.receipt-item.removing {
  opacity: 0;
  transform: translateX(30px);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-color: transparent;
  overflow: hidden;
  transition: all 0.35s ease;
}

/* === Cart Actions Bar === */
.cart-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--pw-border, #e5e7eb);
  background: var(--pw-surface-alt, #fafbfc);
  flex-wrap: wrap;
  gap: 10px;
}
.action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-update-cart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--pw-border, #e5e7eb);
  border-radius: var(--cart-radius-sm);
  color: var(--pw-text-2, #374151);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--cart-transition), border-color var(--cart-transition);
}
.btn-update-cart:hover {
  background: var(--pw-bg-alt, #f3f4f6);
  border-color: var(--pw-border-hover, #d1d5db);
}
.btn-continue-shop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--pw-brand-light, var(--cart-brand-light));
  border: 1px solid hsla(160, 84%, 30%, 0.12);
  border-radius: var(--cart-radius-sm);
  color: var(--pw-brand, var(--cart-brand));
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--cart-transition);
}
.btn-continue-shop:hover {
  background: hsla(160, 84%, 30%, 0.15);
}

.cart-total-inline {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pw-text-2, #374151);
}
.cart-total-inline .total-value {
  color: var(--pw-text, #1a1a2e);
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* =============================================
   RECEIPT SIDEBAR
   ============================================= */
.receipt-sidebar {
  position: sticky;
  top: 20px;
}
.receipt-card {
  background: var(--pw-surface, #fff);
  border: 1px solid hsl(160, 40%, 92%);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 140, 105, 0.08);
}

.receipt-header {
  padding: 16px 18px;
  border-bottom: none;
  background: linear-gradient(135deg, hsl(35, 18%, 90%), hsl(35, 25%, 92%));
}
.receipt-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pw-text, #1a1a2e);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.receipt-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #008c69, #523db8);
  color: #fff;
  border-radius: 10px;
  font-size: 0.85rem;
}

.receipt-body {
  padding: 16px;
}

/* Receipt Items */
.receipt-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.receipt-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.receipt-item:last-child {
  border-bottom: none;
}
.receipt-item-info {
  flex: 1;
  min-width: 0;
}
.receipt-item-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pw-text, #1a1a2e);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.receipt-item-qty {
  font-size: 0.7rem;
  color: var(--pw-text-3, #6b7280);
  margin-top: 2px;
}
.receipt-item-price {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pw-text, #1a1a2e);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.receipt-divider {
  border: none;
  border-top: 1.5px dashed var(--pw-border, #e5e7eb);
  margin: 12px 0;
}

/* === Coupon Section === */
.coupon-wrapper {
  margin-bottom: 14px;
}
.applied-coupon-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--pw-success-light, var(--cart-success-light));
  border: 1px solid hsla(152, 68%, 38%, 0.2);
  border-radius: var(--cart-radius-sm);
  gap: 10px;
}
.coupon-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.coupon-icon { color: var(--pw-success, var(--cart-success)); font-size: 1rem; }
.coupon-code-text {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pw-success, var(--cart-success));
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.coupon-percent {
  display: block;
  font-size: 0.7rem;
  color: hsl(152, 50%, 35%);
}
.btn-remove-coupon {
  width: 36px;
  height: 36px;
  border: none;
  background: hsla(0, 0%, 0%, 0.06);
  border-radius: 50%;
  color: var(--pw-text-3, #6b7280);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transition: background var(--cart-transition), color var(--cart-transition);
}
.btn-remove-coupon:hover {
  background: var(--pw-danger-light, var(--cart-danger-light));
  color: var(--pw-danger, var(--cart-danger));
}

.coupon-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--pw-bg-alt, #f3f4f6);
  border: 1.5px dashed var(--pw-border, #e5e7eb);
  border-radius: var(--cart-radius-sm);
  color: var(--pw-text-3, #6b7280);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--cart-transition), background var(--cart-transition);
}
.coupon-trigger:hover {
  border-color: var(--pw-brand, var(--cart-brand));
  background: var(--pw-brand-light, var(--cart-brand-light));
  color: var(--pw-brand, var(--cart-brand));
}
.trigger-content {
  display: flex;
  align-items: center;
  gap: 6px;
}
.trigger-icon {
  font-size: 0.65rem;
  transition: transform var(--cart-transition);
}
.coupon-trigger:hover .trigger-icon { transform: rotate(90deg); }

.coupon-form {
  display: none;
  margin-top: 10px;
}
.coupon-form.show,
.coupon-form.open { display: block; }
.coupon-input-row {
  display: flex;
  gap: 8px;
}
.coupon-input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--pw-border, #e5e7eb);
  border-radius: var(--cart-radius-sm);
  font-size: 16px;
  font-family: inherit;
  color: var(--pw-text, #1a1a2e);
  background: var(--pw-surface, #fff);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: border-color var(--cart-transition), box-shadow var(--cart-transition);
}
.coupon-input:focus {
  outline: none;
  border-color: var(--pw-brand, var(--cart-brand));
  box-shadow: 0 0 0 3px hsla(160, 84%, 30%, 0.1);
}
.coupon-input::placeholder { color: var(--pw-text-4, #9ca3af); text-transform: none; letter-spacing: normal; }
.btn-apply-coupon {
  padding: 12px 18px;
  min-height: 44px;
  background: var(--pw-brand, var(--cart-brand));
  color: #fff;
  border: none;
  border-radius: var(--cart-radius-sm);
  font-weight: 600;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--cart-transition), transform var(--cart-transition);
}
.btn-apply-coupon:hover {
  background: var(--pw-brand-hover, var(--cart-brand-hover));
  transform: translateY(-1px);
}
.btn-apply-coupon:active { transform: scale(0.97); }

.coupon-message {
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  display: none;
}
.coupon-message.success {
  display: block;
  color: var(--pw-success, var(--cart-success));
  background: var(--pw-success-light, var(--cart-success-light));
}
.coupon-message.error {
  display: block;
  color: var(--pw-danger, var(--cart-danger));
  background: var(--pw-danger-light, var(--cart-danger-light));
}

/* === Receipt Calculations === */
.receipt-calc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
}
.receipt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.receipt-row .label {
  font-size: 0.8rem;
  color: var(--pw-text-3, #6b7280);
}
.receipt-row .label small {
  color: var(--pw-text-4, #9ca3af);
  font-size: 0.7rem;
}
.receipt-row .value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pw-text, #1a1a2e);
  font-variant-numeric: tabular-nums;
}
.receipt-row.discount .value { color: var(--pw-danger, var(--cart-danger)); }
.receipt-row.shipping .value { color: var(--pw-success, var(--cart-success)); font-weight: 500; }
.receipt-row.shipping .value i { color: var(--pw-success, var(--cart-success)); }

/* Receipt Total */
.receipt-total {
  background: linear-gradient(135deg, var(--pw-brand-light, var(--cart-brand-light)), hsla(162, 50%, 93%, 0.6));
  border: 1px solid hsla(160, 84%, 30%, 0.15);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin-top: 8px;
}
.total-label {
  display: block;
  font-size: 0.7rem;
  color: var(--pw-text-3, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-weight: 600;
}
.total-amount {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--pw-brand-hover, var(--cart-brand-hover));
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

/* Checkout Button */
.btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #008c69, #523db8);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  min-height: 48px;
  box-shadow: 0 4px 16px hsla(160, 84%, 30%, 0.25);
  transition: transform var(--cart-transition), box-shadow var(--cart-transition);
  position: relative;
  overflow: hidden;
}
.btn-checkout::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, hsla(0,0%,100%,0.15), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}
.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px hsla(160, 84%, 30%, 0.35);
  color: #fff;
}
.btn-checkout:hover::after { left: 120%; }
.btn-checkout:active { transform: scale(0.98); }

.checkout-note {
  text-align: center;
  font-size: 0.7rem;
  color: var(--pw-text-4, #9ca3af);
  margin: 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.checkout-note i { color: var(--pw-success, var(--cart-success)); }

/* === Trust Strip === */
.trust-strip {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 12px 16px;
  border-top: 1px solid var(--pw-border, #e5e7eb);
  background: var(--pw-surface-alt, #fafbfc);
}
.trust-strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  color: var(--pw-text-3, #6b7280);
  font-weight: 500;
  text-align: center;
}
.trust-strip-item i {
  font-size: 0.85rem;
  color: var(--pw-brand, var(--cart-brand));
  transition: transform 0.3s ease;
}
.trust-strip-item:hover i { transform: scale(1.15); }

/* === Security Strip === */
.security-strip {
  margin-top: 14px;
  background: var(--pw-surface, #fff);
  border: 1px solid var(--pw-border, #e5e7eb);
  border-radius: var(--cart-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.security-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--pw-text-3, #6b7280);
  line-height: 1.4;
}
.security-item i {
  font-size: 0.85rem;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
}
.icon-green {
  color: var(--pw-success, var(--cart-success));
  background: var(--pw-success-light, var(--cart-success-light));
}
.icon-blue {
  color: var(--pw-info, #3b82f6);
  background: hsla(210, 80%, 52%, 0.1);
}
.icon-amber {
  color: var(--pw-warm, #f59e0b);
  background: var(--pw-warm-light, hsla(38, 92%, 50%, 0.1));
}

/* =============================================
   EMPTY CART STATE
   ============================================= */
.empty-cart {
  padding: 30px 0 50px;
  display: flex;
  justify-content: center;
}
.empty-cart-card {
  background: var(--pw-surface, #fff);
  border: 1px solid var(--pw-border, #e5e7eb);
  border-radius: var(--cart-radius);
  padding: 40px 24px;
  text-align: center;
  max-width: 480px;
  width: 100%;
}

.empty-cart-illustration {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 24px;
}
.empty-cart-icon {
  width: 90px;
  height: 90px;
  background: var(--pw-bg-alt, #f3f4f6);
  border: 2px solid var(--pw-border, #e5e7eb);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--pw-text-4, #9ca3af);
  animation: emptyPulse 3s ease-in-out infinite;
}
.empty-cart-plus {
  position: absolute;
  bottom: 0;
  right: -4px;
  width: 28px;
  height: 28px;
  background: var(--pw-brand, var(--cart-brand));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.65rem;
  box-shadow: 0 4px 12px hsla(160, 84%, 30%, 0.25);
  animation: emptyBounce 2s ease-in-out infinite;
}
@keyframes emptyPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes emptyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.empty-cart-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--pw-text, #1a1a2e);
  margin: 0 0 10px;
}
.empty-cart-text {
  font-size: 0.85rem;
  color: var(--pw-text-3, #6b7280);
  line-height: 1.7;
  margin: 0 0 24px;
}

.btn-shop-now {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--pw-brand, var(--cart-brand)) 0%, hsl(160, 84%, 24%) 100%);
  color: #fff;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 16px hsla(160, 84%, 30%, 0.25);
  transition: transform var(--cart-transition), box-shadow var(--cart-transition);
  min-height: 48px;
}
.btn-shop-now:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px hsla(160, 84%, 30%, 0.35);
  color: #fff;
}
.btn-shop-now:active { transform: scale(0.97); }

/* Delivery Banner */
.delivery-banner {
  margin-top: 28px;
  background: var(--pw-surface-alt, #fafbfc);
  border: 1px solid var(--pw-border, #e5e7eb);
  border-radius: 12px;
  padding: 16px;
  text-align: right;
}
.banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.delivery-truck {
  width: 42px;
  height: 42px;
  background: var(--pw-brand-light, var(--cart-brand-light));
  border-radius: var(--cart-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pw-brand, var(--cart-brand));
  font-size: 1.1rem;
  flex-shrink: 0;
}
.banner-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pw-text, #1a1a2e);
  display: flex;
  align-items: center;
  gap: 6px;
}
.banner-subtitle {
  font-size: 0.75rem;
  color: var(--pw-text-3, #6b7280);
  margin-top: 2px;
}

.banner-features {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--pw-border, #e5e7eb);
  flex-wrap: wrap;
}
.banner-feature {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--pw-text-3, #6b7280);
  font-weight: 500;
}
.banner-feature i { color: var(--pw-success, var(--cart-success)); font-size: 0.75rem; }

/* =============================================
   CONFIRMATION MODAL
   ============================================= */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
.confirm-card {
  background: var(--pw-surface, #fff);
  border-radius: var(--cart-radius);
  box-shadow: var(--cart-shadow-lg);
  max-width: 360px;
  width: 100%;
  padding: 28px 24px;
  animation: scaleIn 0.3s ease;
  text-align: center;
}
.confirm-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--pw-danger-light, var(--cart-danger-light));
  color: var(--pw-danger, var(--cart-danger));
  margin: 0 auto 16px;
}
.confirm-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pw-text, #1a1a2e);
  margin: 0 0 6px;
}
.confirm-card p {
  font-size: 0.85rem;
  color: var(--pw-text-3, #6b7280);
  margin: 0 0 20px;
  line-height: 1.6;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.confirm-actions .btn-cancel-remove,
.confirm-actions .btn-confirm-remove {
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--cart-radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--cart-transition), transform var(--cart-transition);
  min-height: 44px;
}
.btn-cancel-remove {
  background: transparent;
  border-color: var(--pw-border, #e5e7eb);
  color: var(--pw-text-2, #374151);
}
.btn-cancel-remove:hover {
  background: var(--pw-bg-alt, #f3f4f6);
}
.btn-confirm-remove {
  background: var(--pw-danger, var(--cart-danger));
  color: #fff;
  box-shadow: 0 4px 12px hsla(0, 72%, 51%, 0.25);
}
.btn-confirm-remove:hover {
  background: hsl(0, 72%, 45%);
  transform: translateY(-1px);
}
.btn-confirm-remove:active,
.btn-cancel-remove:active { transform: scale(0.97); }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 400px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--pw-surface, #fff);
  border: 1px solid var(--pw-border, #e5e7eb);
  border-radius: var(--cart-radius-sm);
  box-shadow: var(--cart-shadow-lg);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--pw-text, #1a1a2e);
  pointer-events: auto;
  animation: toastIn 0.35s ease;
}
.toast.success { border-color: var(--pw-success, var(--cart-success)); }
.toast.success i { color: var(--pw-success, var(--cart-success)); }
.toast.error { border-color: var(--pw-danger, var(--cart-danger)); }
.toast.error i { color: var(--pw-danger, var(--cart-danger)); }
.toast-exit { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-8px); }
}

/* =============================================
   DESKTOP LAYOUT (992px+)
   ============================================= */
@media (min-width: 992px) {
  .cart-container .container { padding-left: 24px; padding-right: 24px; }
  .cart-header { padding: 24px 0 16px; }
  .cart-title { font-size: 1.75rem; }
  .cart-title-icon { width: 44px; height: 44px; font-size: 1.1rem; }
  .cart-steps { padding: 16px 0 32px; }
  .step-line { width: 48px; margin: 0 8px; }
  .step-num { width: 30px; height: 30px; font-size: 0.75rem; }

  .cart-items-header { padding: 16px 24px; }
  
  /* Desktop: horizontal row layout for items */
  .cart-item {
    display: grid;
    grid-template-columns: 72px 1fr auto auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px 24px;
    flex-wrap: nowrap;
  }
  .cart-item-image { width: 72px; height: 72px; }
  .cart-item-name { font-size: 0.95rem; }
  
  .cart-actions-bar { padding: 14px 24px; }
  .receipt-body { padding: 20px 24px; }
  .receipt-header { padding: 16px 24px; }
  .receipt-total { padding: 20px; }
  .total-amount { font-size: 1.75rem; }
  
  .empty-cart-card { padding: 48px 32px; }
  .empty-cart-title { font-size: 1.375rem; }
  .empty-cart-text { font-size: 0.95rem; }
  .delivery-banner { padding: 20px; }
}

/* =============================================
   MOBILE LAYOUT — CARD-STYLE ITEMS
   Max 991px: items become stacked cards
   ============================================= */
@media (max-width: 991px) {
  .cart-container { padding-bottom: 20px; } /* body already has 68px from mobile nav */
  
  .cart-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .cart-title { font-size: 1.3rem; }
  .cart-subtitle { font-size: 0.8rem; }
  
  /* Cart items become stacked cards */
  .cart-item {
    display: flex;
    flex-wrap: wrap;
    padding: 14px;
    gap: 10px;
    position: relative;
  }
  
  /* Row 1: Image + Info + Remove */
  .cart-item-image {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
  }
  .cart-item-info {
    flex: 1;
    min-width: 0;
    padding-right: 36px; /* space for remove btn */
  }
  .cart-item-name { font-size: 0.85rem; }
  
  .cart-item-remove {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 44px;
    height: 44px;
    font-size: 0.8rem;
  }
  [dir="ltr"] .cart-item-remove {
    left: auto;
    right: 14px;
  }
  .cart-item-info {
    padding-right: 0;
    padding-left: 36px;
  }
  [dir="ltr"] .cart-item-info {
    padding-left: 0;
    padding-right: 36px;
  }
  
  /* Row 2: Qty stepper + Subtotal side by side, full width */
  .qty-stepper {
    order: 3;
  }
  .cart-item-subtotal {
    order: 4;
    text-align: end;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    min-width: auto;
  }
  [dir="ltr"] .cart-item-subtotal {
    margin-right: 0;
    margin-left: auto;
  }
  .subtotal-label {
    display: inline;
    margin-bottom: 0;
  }
  .subtotal-value { display: inline; font-size: 0.95rem; }
  .subtotal-currency { display: inline; }
  
  /* Actions bar stacks */
  .cart-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px;
  }
  .action-group {
    display: flex;
    gap: 8px;
  }
  .action-group > * { flex: 1; justify-content: center; text-align: center; }
  .cart-total-inline {
    text-align: center;
    padding: 10px 14px;
    margin-top: 2px;
    background: var(--pw-brand-light, var(--cart-brand-light));
    border-radius: var(--cart-radius-sm);
    font-size: 1rem;
    font-weight: 700;
  }
  .cart-total-inline .total-value {
    font-size: 1.15rem;
    color: var(--pw-brand-hover, var(--cart-brand-hover));
  }

  /* Receipt sidebar unsticks */
  .receipt-sidebar {
    position: static;
    margin-top: 16px;
  }
  
  .banner-features {
    flex-direction: column;
    gap: 8px;
  }
}

/* =============================================
   SMALL MOBILE (<= 575px)
   ============================================= */
@media (max-width: 575px) {
  .cart-container .container { padding-left: 12px; padding-right: 12px; }
  
  .cart-breadcrumb nav { font-size: 0.72rem; gap: 4px; }
  .cart-header { padding: 14px 0 8px; }
  .cart-title { font-size: 1.15rem; gap: 8px; }
  .cart-title-icon { width: 34px; height: 34px; font-size: 0.9rem; }
  .cart-subtitle { font-size: 0.75rem; }
  .cart-count-badge { font-size: 0.72rem; padding: 4px 10px; }
  
  .cart-steps {
    padding: 10px 0 18px;
    font-size: 0.7rem;
  }
  .step-num {
    width: 24px;
    height: 24px;
    font-size: 0.6rem;
  }
  .step-line { width: 20px; margin: 0 4px; }

  .cart-items-header { padding: 10px 12px; }
  .cart-items-header h2 { font-size: 0.85rem; }
  
  .cart-item {
    padding: 12px;
    gap: 8px;
  }
  .cart-item-image { width: 48px; height: 48px; border-radius: 8px; }
  .cart-item-name { font-size: 0.8rem; }
  .cart-item-code { font-size: 0.65rem; }
  .cart-item-unit-price { font-size: 0.72rem; }
  
  .cart-item-remove {
    top: 10px;
    left: 10px;
    width: 44px;
    height: 44px;
  }
  [dir="ltr"] .cart-item-remove {
    left: auto;
    right: 10px;
  }
  .cart-item-info {
    padding-left: 32px;
  }
  [dir="ltr"] .cart-item-info {
    padding-left: 0;
    padding-right: 32px;
  }
  
  .qty-btn { width: 44px; height: 44px; }
  .cart-quantity { width: 40px; font-size: 16px; }
  .subtotal-value { font-size: 0.85rem; }
  
  .cart-actions-bar { padding: 10px 12px; }
  .btn-update-cart, .btn-continue-shop {
    padding: 10px 14px;
    font-size: 0.8rem;
    min-height: 44px;
  }
  .btn-update-cart {
    font-size: 0.75rem;
    color: var(--pw-text-4, #9ca3af);
    border-color: var(--pw-border, #e5e7eb);
  }
  
  .receipt-header { padding: 12px; }
  .receipt-body { padding: 12px; }
  .receipt-total { padding: 14px; }
  .total-amount { font-size: 1.4rem; }
  .btn-checkout { padding: 12px 16px; font-size: 0.9rem; min-height: 44px; }
  
  .trust-strip { padding: 10px 12px; }
  .trust-strip-item { font-size: 0.6rem; }
  .trust-strip-item i { font-size: 0.75rem; }
  
  .security-strip { padding: 12px; margin-top: 10px; }
  .security-item { font-size: 0.72rem; gap: 8px; }
  .security-item i { width: 22px; height: 22px; font-size: 0.75rem; }
  
  .empty-cart-card { padding: 28px 16px; border-radius: 12px; }
  .empty-cart-illustration { width: 70px; height: 70px; margin-bottom: 20px; }
  .empty-cart-icon { width: 70px; height: 70px; font-size: 1.6rem; }
  .empty-cart-plus { width: 24px; height: 24px; font-size: 0.55rem; }
  .empty-cart-title { font-size: 1.05rem; }
  .empty-cart-text { font-size: 0.8rem; margin-bottom: 20px; }
  .btn-shop-now { padding: 12px 24px; font-size: 0.9rem; min-height: 44px; }
  
  .delivery-banner { padding: 12px; margin-top: 20px; }
  .delivery-truck { width: 36px; height: 36px; font-size: 0.95rem; }
  .banner-title { font-size: 0.78rem; }
  .banner-subtitle { font-size: 0.7rem; }
  .banner-feature { font-size: 0.7rem; }
  
  .confirm-card { padding: 24px 16px; }
  .confirm-icon { width: 44px; height: 44px; font-size: 1.2rem; }
  .confirm-card h3 { font-size: 0.95rem; }
  .confirm-card p { font-size: 0.8rem; }
  .confirm-actions { flex-direction: column; gap: 8px; }
  .confirm-actions .btn-cancel-remove,
  .confirm-actions .btn-confirm-remove {
    width: 100%;
    justify-content: center;
  }
}

/* =============================================
   VERY SMALL MOBILE (<= 380px)
   ============================================= */
@media (max-width: 380px) {
  .cart-title { font-size: 1rem; }
  .cart-title-icon { width: 30px; height: 30px; font-size: 0.8rem; }
  .cart-subtitle { display: none; }
  
  .cart-steps { font-size: 0.65rem; }
  .step-num { width: 22px; height: 22px; font-size: 0.55rem; }
  .step-line { width: 14px; }
  
  .cart-item-image { width: 42px; height: 42px; }
  .cart-item-name { font-size: 0.75rem; -webkit-line-clamp: 1; }
  
  .receipt-item-name { font-size: 0.8rem; }
  .receipt-item-price { font-size: 0.8rem; }
  .total-amount { font-size: 1.2rem; }
  
  .empty-cart-title { font-size: 0.95rem; }
  .empty-cart-text { font-size: 0.75rem; }
  .btn-shop-now { padding: 10px 20px; font-size: 0.85rem; }
}

/* =============================================
   MOBILE STICKY CHECKOUT
   ============================================= */
@media (max-width: 991px) {
  .receipt-total {
    background: linear-gradient(135deg, var(--pw-brand-light, var(--cart-brand-light)), hsla(162, 50%, 93%, 0.8));
  }
}

/* =============================================
   REMOVE CONFIRMATION MODAL
   ============================================= */
.cart-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: cartModalFadeIn 0.2s ease;
}

@keyframes cartModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cart-modal {
  background: #fff;
  border-radius: 20px;
  padding: 2rem 1.5rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: cartModalSlideUp 0.25s ease;
}

@keyframes cartModalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cart-modal .modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--cart-danger-light, hsla(0, 72%, 51%, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.3rem;
  color: var(--cart-danger, #e53e3e);
}

.cart-modal h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 0.5rem;
}

.cart-modal p {
  font-size: 0.88rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.cart-modal .modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cart-modal .btn-modal-confirm {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--cart-danger, #e53e3e);
  color: #fff;
  transition: all 0.2s ease;
}

.cart-modal .btn-modal-confirm:hover {
  background: #c53030;
  transform: translateY(-1px);
}

.cart-modal .btn-modal-confirm:active {
  transform: scale(0.97);
}

.cart-modal .btn-modal-cancel {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: #374151;
  transition: all 0.2s ease;
}

.cart-modal .btn-modal-cancel:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* Toast notification for cart */
.cart-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  animation: cartToastIn 0.3s ease;
}

@keyframes cartToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.cart-toast-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  font-size: 0.88rem;
  font-weight: 500;
  color: #1a1a2e;
  white-space: nowrap;
}

.cart-toast .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(13, 122, 74, 0.2);
  border-radius: 50%;
  border-top-color: var(--cart-brand, #0d7a4a);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
  body.cart-page { background: #fff; }
  .cart-breadcrumb,
  .cart-steps,
  .qty-stepper,
  .cart-item-remove,
  .cart-actions-bar,
  .coupon-wrapper,
  .btn-checkout,
  .checkout-note,
  .trust-strip,
  .security-strip,
  .delivery-banner,
  .pw-mobile-nav { display: none !important; }
  .cart-items-section,
  .receipt-card,
  .empty-cart-card {
    border: 1px solid #ddd;
    box-shadow: none;
  }
}

/* =============================================
   ACCESSIBILITY
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  .empty-cart-icon,
  .empty-cart-plus {
    animation: none;
  }
  .btn-checkout::after,
  .btn-shop-now::after {
    display: none;
  }
}
