/* =========================================================
   CHECKOUT, PAYMENT GATEWAY & INVOICE STYLES
   ========================================================= */

.checkout-page {
  padding: 40px 0 80px;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 32px;
  align-items: flex-start;
}

.checkout-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.checkout-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

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

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* Payment Gateway Selector */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-method-option {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.payment-method-option:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.payment-method-option.selected {
  border-color: var(--primary);
  background: #fffbeb;
}

.pm-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pm-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--secondary);
}

.pm-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.pm-badges {
  display: flex;
  gap: 6px;
}

.pm-badge-img {
  height: 22px;
  border-radius: 4px;
}

/* Dynamic UPI Gateway Box */
.upi-gateway-box {
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
}

.qr-frame {
  display: inline-block;
  padding: 16px;
  background: #ffffff;
  border: 2px solid #0f172a;
  border-radius: 12px;
  margin: 14px 0;
  box-shadow: var(--shadow-md);
}

.qr-image {
  width: 180px;
  height: 180px;
  display: block;
}

.upi-id-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  padding: 6px 16px;
  border-radius: 20px;
  font-family: monospace;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 12px;
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  cursor: pointer;
  font-weight: 600;
}

/* Order Summary Box */
.order-summary-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: 90px;
}

.summary-items {
  margin-bottom: 18px;
  max-height: 320px;
  overflow-y: auto;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.summary-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

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

.summary-item-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.summary-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.summary-item-price {
  font-size: 14px;
  font-weight: 700;
}

.coupon-section {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #475569;
  padding: 8px 0;
}

.summary-row.total {
  font-size: 18px;
  font-weight: 800;
  color: var(--secondary);
  border-top: 2px solid var(--border-color);
  padding-top: 14px;
  margin-top: 8px;
}

/* Printable GST Invoice */
.invoice-container {
  background: #ffffff;
  max-width: 850px;
  margin: 40px auto;
  padding: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 24px;
  border-bottom: 2px solid #0f172a;
  margin-bottom: 24px;
}

.invoice-title {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

.invoice-table th,
.invoice-table td {
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  text-align: left;
  font-size: 13px;
}

.invoice-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #1e293b;
}

@media print {
  body * {
    visibility: hidden;
  }
  .invoice-container, .invoice-container * {
    visibility: visible;
  }
  .invoice-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    box-shadow: none;
    border: none;
  }
  .no-print {
    display: none !important;
  }
}

/* Saved Address Cards Grid */
.ssp-address-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.ssp-addr-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  background: #f8fafc;
  transition: all 0.2s ease;
  position: relative;
}

.ssp-addr-card:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.ssp-addr-card.selected {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.12);
}

.ssp-addr-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.ssp-addr-badge.home { background: #dbeafe; color: #1e40af; }
.ssp-addr-badge.office { background: #e0e7ff; color: #4338ca; }
.ssp-addr-badge.site { background: #fef3c7; color: #92400e; }
