/* ── Cart & Checkout Page Styles ── */
.cart-page {
  min-height: 80vh;
  padding: 3rem 1.5rem;
  overflow-x: hidden;
  background: 
    radial-gradient(circle at 5% 5%, #eff9f2 0%, transparent 25%),
    radial-gradient(circle at 95% 95%, #fff9eb 0%, transparent 25%),
    #fafbf8;
}

.cart-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2.5rem;
  align-items: flex-start;
}

/* Cart Header */
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e9eee9;
  margin-bottom: 2rem;
}

.cart-header h1 {
  margin: 0;
  font-size: 2.2rem;
  color: #1a3c2a;
}

.item-count {
  font-weight: 600;
  color: #6b7280;
}

/* Cart Items */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cart-item {
  display: flex;
  gap: 1.5rem;
  background: white;
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid #eef2ef;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease;
}

.cart-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
}

.item-img-box {
  width: 120px;
  height: 120px;
  background: #f8faf9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.item-img-box img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.item-info h3 {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  color: #173f2d;
}

.item-cat {
  margin: 0;
  font-size: 0.85rem;
  color: #147a4a;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.item-price-row {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-top: 1rem;
}

.unit-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1a3c2a;
  min-width: 60px;
}

.quantity-controls {
  display: flex;
  align-items: center;
  background: #f3f7f4;
  border-radius: 999px;
  padding: 0.25rem;
}

.quantity-controls button {
  width: 32px;
  height: 32px;
  border: none;
  background: white;
  color: #1a5f3d;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.qty {
  padding: 0 1rem;
  font-weight: 700;
  color: #173f2d;
  min-width: 40px;
  text-align: center;
}

.remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  background: transparent;
  border: none;
  color: #ad2626;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  text-transform: uppercase;
}

/* Summary Box */
.cart-summary {
  background: white;
  padding: 2.5rem;
  border-radius: 24px;
  border: 1px solid #dce8df;
  box-shadow: 0 12px 30px rgba(18, 62, 38, 0.08);
  position: sticky;
  top: 100px;
}

.cart-summary h2 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  color: #173f2d;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  color: #4b5563;
  font-weight: 500;
}

.summary-row.total {
  border-top: 1px solid #eef2ef;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: #173f2d;
}

.free {
  color: #1a7045;
  font-weight: 800;
}

.place-order-btn {
  width: 100%;
  margin-top: 2rem;
  padding: 1.1rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, #167447, #249a60);
  color: white;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(22, 116, 71, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.place-order-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(22, 116, 71, 0.35);
}

.place-order-btn:disabled {
  background: #7ca88e;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

.input-error {
  border-color: #e14a5b !important;
  background: #fffafa !important;
}

/* Stepper */
.checkout-stepper {
  max-width: 800px;
  margin: 0 auto 3rem;
  display: flex;
  justify-content: space-between;
  position: relative;
}

.checkout-stepper::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: #eef2ef;
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.step-number {
  width: 44px;
  height: 44px;
  background: white;
  border: 2px solid #eef2ef;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #9ca3af;
  transition: all 0.3s ease;
}

.step-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.step-item.active .step-number {
  border-color: #167447;
  background: #f0f7f2;
  color: #167447;
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(22, 116, 71, 0.15);
}

.step-item.active .step-text { color: #167447; }

.step-item.completed .step-number {
  background: #167447;
  border-color: #167447;
  color: white;
}

.step-item.completed .step-text { color: #167447; }

/* Forms & Other Sections */
.checkout-form-section {
  background: white;
  padding: 1.5rem;
  border-radius: 24px;
  border: 1px solid #eef2ef;
  display: none; /* Controlled by JS */
}

.checkout-form-section.active { display: block; }

.back-link {
  background: none;
  border: none;
  color: #147a4a;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
}

.shipping-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.form-group.full { grid-column: span 2; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label { font-size: 0.9rem; font-weight: 700; color: #1a3c2a; }

.form-group input {
  padding: 0.8rem 1rem;
  border: 1.5px solid #eef2ef;
  border-radius: 12px;
  outline: none;
}

.form-group input:focus { border-color: #167447; }

.payment-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.payment-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 2px solid #f3f7f4;
  border-radius: 16px;
  cursor: pointer;
}

.payment-card.active { border-color: #167447; background: #f0f7f2; }

.pay-radio {
  width: 20px;
  height: 20px;
  border: 2px solid #eef2ef;
  border-radius: 50%;
  position: relative;
}

.payment-card.active .pay-radio::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: #167447;
  border-radius: 50%;
}

/* Success Card */
.success-card {
  background: white;
  padding: 4rem 2rem;
  border-radius: 30px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0,0,0,0.06);
  max-width: 500px;
  margin: 0 auto;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: #e2f3e8;
  color: #1a7045;
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 0 auto 2rem;
}

/* Response States */
@media (max-width: 992px) {
  .cart-container { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
}

@media (max-width: 640px) {
  .site-header.header-hidden,
  .site-header.mobile-header-hide {
    display: none !important;
  }

  .cart-page {
    padding: 0.7rem 0.45rem 1.1rem;
  }

  .checkout-stepper {
    margin: 0 auto 1.1rem;
    gap: 0.25rem;
  }

  .step-item {
    gap: 0.35rem;
    min-width: 0;
  }

  .step-number {
    width: 38px;
    height: 38px;
    font-size: 0.88rem;
  }

  .cart-item {
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 0.8rem;
    padding: 0.85rem;
    border-radius: 18px;
  }

  .item-img-box {
    width: 68px;
    height: 68px;
    border-radius: 14px;
  }

  .item-info h3 {
    font-size: 1.02rem;
    line-height: 1.25;
  }

  .item-cat {
    font-size: 0.72rem;
  }

  .item-price-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.65rem;
  }

  .unit-price {
    font-size: 1.05rem;
  }

  .quantity-controls {
    width: 100%;
    justify-content: space-between;
  }

  .step-text {
    display: none;
  }

  .cart-summary {
    padding: 1.25rem;
    border-radius: 18px;
  }

  .cart-summary h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .summary-row {
    margin-bottom: 0.9rem;
    font-size: 0.92rem;
  }

  .summary-row.total {
    font-size: 1.1rem;
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .place-order-btn {
    margin-top: 1.2rem;
    padding: 0.95rem;
    font-size: 1rem;
  }

  .shipping-form {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-top: 1rem;
  }

  .form-group.full {
    grid-column: span 1;
  }

  .checkout-form-section {
    padding: 1rem;
    border-radius: 18px;
  }

  .payment-card {
    padding: 1rem;
    gap: 0.9rem;
    border-radius: 14px;
  }

  .pay-label {
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .review-container {
    gap: 0.85rem;
  }

  .review-section {
    padding: 0.95rem;
  }

  .success-card {
    padding: 2rem 1rem;
    border-radius: 22px;
  }

  .success-icon {
    width: 64px;
    height: 64px;
    font-size: 2.2rem;
    margin-bottom: 1rem;
  }
}

/* ── Empty Cart Styles ── */
.empty-cart-card {
  text-align: center;
  padding: 5rem 2rem;
  background: white;
  border-radius: 30px;
  border: 1px solid #eef2ef;
  box-shadow: 0 15px 35px rgba(0,0,0,0.04);
  max-width: 600px;
  margin: 2rem auto;
}

.empty-cart-card h1 {
  font-size: 2.4rem;
  color: #167447; /* Matched the exact green from the mockup */
  margin-bottom: 1rem;
}

.empty-cart-card p {
  color: #1a3c2a;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.shop-now-btn, a.shop-now-btn, a.shop-now-btn:link, a.shop-now-btn:visited {
  display: inline-block !important;
  padding: 1rem 2.5rem !important;
  background: #167447 !important; /* Solid green like mockup */
  color: white !important;
  text-decoration: none !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  font-size: 1.1rem !important;
  box-shadow: 0 10px 20px rgba(22, 116, 71, 0.2) !important;
  transition: all 0.3s !important;
  margin-top: 1rem !important;
}

.shop-now-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 24px rgba(22, 116, 71, 0.3) !important;
}
