/**
 * Globex Sky — cart.css
 * Styles for the shopping cart page and cart-related UI components.
 */

/* ── Cart Page Layout ─────────────────────────────────────────── */
.cart-layout {
  max-width: 1400px;
  margin: 32px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

/* ── Section Cards ────────────────────────────────────────────── */
.section-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
}

.section-card-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #0a0e27;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Cart Item Row ────────────────────────────────────────────── */
.cart-item {
  display: grid;
  grid-template-columns: auto 80px 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.2s;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item:hover {
  background: #fafbff;
}

.cart-item.removing {
  opacity: 0;
  transform: scaleY(0);
  transition: all 0.3s;
}

.cart-item-image img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.cart-item-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: #0a0e27;
  margin-bottom: 4px;
}

.cart-item-supplier {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 4px;
}

.cart-item-moq {
  font-size: 0.78rem;
  color: #f59e0b;
  font-weight: 500;
}

/* ── Quantity Controls ────────────────────────────────────────── */
.qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.qty-btn:hover:not(:disabled) {
  background: #0052CC;
  color: #fff;
  border-color: #0052CC;
}

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

.qty-input {
  width: 52px;
  height: 30px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: #0a0e27;
  outline: none;
  transition: border-color 0.2s;
}

.qty-input:focus {
  border-color: #0052CC;
}

/* ── Cart Item Actions ────────────────────────────────────────── */
.cart-item-subtotal {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #0052CC;
  min-width: 80px;
  text-align: right;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
  line-height: 1;
}

.cart-item-remove:hover {
  background: #fee2e2;
  color: #ef4444;
}

.save-for-later-btn {
  background: none;
  border: none;
  color: #0052CC;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-family: 'Inter', sans-serif;
}

/* ── Cart Empty State ─────────────────────────────────────────── */
.cart-empty {
  text-align: center;
  padding: 60px 24px;
}

.cart-empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.cart-empty-text {
  color: #64748b;
  font-size: 1rem;
  margin-bottom: 20px;
}

/* ── Order Summary Sidebar ────────────────────────────────────── */
.order-summary {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 24px;
  position: sticky;
  top: 90px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.88rem;
  color: #374151;
  border-bottom: 1px solid #f1f5f9;
}

.summary-row:last-of-type {
  border-bottom: none;
}

.summary-row.total {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #0a0e27;
  padding-top: 16px;
  margin-top: 8px;
  border-top: 2px solid #e2e8f0;
}

.summary-row.discount {
  color: #059669;
}

/* ── Coupon Section ───────────────────────────────────────────── */
.coupon-row {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.coupon-input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: 'Inter', sans-serif;
}

.coupon-input:focus {
  border-color: #0052CC;
}

.coupon-message {
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 6px;
  margin-top: 6px;
  display: none;
}

.coupon-message.success {
  background: #d1fae5;
  color: #059669;
}

.coupon-message.error {
  background: #fee2e2;
  color: #dc2626;
}

/* ── Checkout Button ──────────────────────────────────────────── */
.btn-checkout {
  width: 100%;
  padding: 14px;
  background: #0052CC;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-checkout:hover {
  background: #003d99;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 82, 204, 0.3);
}

/* ── Saved for Later ──────────────────────────────────────────── */
.saved-section {
  margin-top: 24px;
}

.saved-section-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #0a0e27;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Status Badges ────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-pending   { background: #fef3c7; color: #d97706; }
.status-processing { background: #dbeafe; color: #1d4ed8; }
.status-shipped   { background: #e0f2fe; color: #0284c7; }
.status-delivered { background: #d1fae5; color: #059669; }
.status-cancelled { background: #fee2e2; color: #dc2626; }
.status-refunded  { background: #f3e8ff; color: #7c3aed; }

/* ── Order Cards (orders list) ────────────────────────────────── */
.order-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.25s;
}

.order-card:hover {
  box-shadow: 0 6px 24px rgba(0, 82, 204, 0.1);
  border-color: #b3c8f5;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.order-number {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #0a0e27;
}

.order-date {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 2px;
}

.order-items-preview {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.order-item-preview img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
}

.more-items {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}

.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Order Detail ─────────────────────────────────────────────── */
.detail-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #f1f5f9;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-item img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
}

.detail-item-info {
  flex: 1;
}

.detail-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #0a0e27;
  margin-bottom: 4px;
}

.detail-item-meta {
  font-size: 0.82rem;
  color: #64748b;
}

.detail-item-total {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: #0052CC;
  font-size: 0.95rem;
}

/* ── Order Timeline ───────────────────────────────────────────── */
.timeline-entry {
  display: flex;
  gap: 16px;
  padding-bottom: 20px;
  position: relative;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.timeline-entry:last-child::before {
  display: none;
}

.timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 3px solid;
}

.timeline-dot.status-pending    { border-color: #d97706; background: #fef3c7; }
.timeline-dot.status-processing { border-color: #1d4ed8; background: #dbeafe; }
.timeline-dot.status-shipped    { border-color: #0284c7; background: #e0f2fe; }
.timeline-dot.status-delivered  { border-color: #059669; background: #d1fae5; }
.timeline-dot.status-cancelled  { border-color: #dc2626; background: #fee2e2; }

.timeline-status {
  font-weight: 600;
  font-size: 0.9rem;
  color: #0a0e27;
}

.timeline-description {
  font-size: 0.83rem;
  color: #64748b;
  margin-top: 2px;
}

.timeline-date {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* ── Address Options (Checkout) ───────────────────────────────── */
.address-option {
  display: flex;
  gap: 12px;
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.address-option:hover {
  border-color: #93c5fd;
  background: #fafbff;
}

.address-option.selected {
  border-color: #0052CC;
  background: #f0f4ff;
}

.address-option input[type="radio"] {
  flex-shrink: 0;
  margin-top: 3px;
  accent-color: #0052CC;
}

.address-label-badge {
  display: inline-flex;
  padding: 2px 8px;
  background: #e2e8f0;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.default-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #d1fae5;
  color: #059669;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  margin-top: 6px;
}

/* ── Shipping Options ─────────────────────────────────────────── */
.shipping-option {
  display: flex;
  gap: 12px;
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.shipping-option:hover {
  border-color: #93c5fd;
}

.shipping-option.selected {
  border-color: #0052CC;
  background: #f0f4ff;
}

.shipping-option-content {
  flex: 1;
}

.shipping-option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.shipping-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: #0a0e27;
}

.shipping-price {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: #0052CC;
  font-size: 0.95rem;
}

.free-badge {
  background: #d1fae5;
  color: #059669;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
}

.shipping-carrier {
  font-size: 0.82rem;
  color: #374151;
  margin-bottom: 4px;
}

.shipping-description {
  font-size: 0.78rem;
  color: #64748b;
}

/* ── Payment Options ──────────────────────────────────────────── */
.payment-methods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.payment-option {
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.payment-option:hover {
  border-color: #93c5fd;
}

.payment-option.selected {
  border-color: #0052CC;
  background: #f0f4ff;
}

.payment-option-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.payment-option-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #0a0e27;
}

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: #64748b;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  color: #cbd5e1;
}

.empty-state h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  color: #0a0e27;
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 20px;
}

/* ── Pagination ───────────────────────────────────────────────── */
.orders-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination-btn {
  padding: 8px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-btn:hover {
  background: #f0f4ff;
  border-color: #0052CC;
}

.pagination-btn.active {
  background: #0052CC;
  color: #fff;
  border-color: #0052CC;
}

/* ── Checkout Step Indicators ─────────────────────────────────── */
.checkout-steps {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  padding: 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.step-indicator + .step-indicator::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 16px;
  width: 60px;
  height: 2px;
  background: #e2e8f0;
}

.step-indicator.completed + .step-indicator::before {
  background: #0052CC;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #94a3b8;
  transition: all 0.3s;
}

.step-indicator.active .step-number {
  border-color: #0052CC;
  background: #0052CC;
  color: #fff;
}

.step-indicator.completed .step-number {
  border-color: #0052CC;
  background: #0052CC;
  color: #fff;
}

.step-label {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
}

.step-indicator.active .step-label,
.step-indicator.completed .step-label {
  color: #0052CC;
  font-weight: 500;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .order-summary {
    position: static;
  }

  .cart-item {
    grid-template-columns: 60px 1fr auto;
    grid-template-rows: auto auto;
  }

  .payment-methods-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .cart-item {
    grid-template-columns: 56px 1fr;
  }

  .checkout-steps {
    gap: 0;
  }

  .step-indicator + .step-indicator::before {
    width: 30px;
  }
}
