/* ==========================================================================
   Native Checkout & Order Success Styles
   ========================================================================== */

/* The page already renders this inside .container, so no second container
   here — a nested max-width made the checkout sit inset from the page hero. */
.native-checkout-container {
  width: 100%;
  margin: 0 0 3rem 0;
  padding: 0;
}

.native-checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .native-checkout-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
}

.checkout-form-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.checkout-step-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0f172a;
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.step-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}

.step-header p {
  font-size: 0.825rem;
  margin: 0.15rem 0 0 0;
  color: #64748b;
}

.checkout-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .checkout-form-grid {
    grid-template-columns: 1fr;
  }
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field label {
  font-size: 0.825rem;
  font-weight: 600;
  color: #334155;
}

.form-field .required {
  color: #ef4444;
}

.form-field input,
.form-field select {
  padding: 0.75rem 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #0f172a;
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input:focus,
.form-field select:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.form-field .input-disabled {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

/* GST Section */
.gst-toggle-header {
  display: flex;
  align-items: center;
}

.gst-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.gst-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
}

.gst-label-text strong {
  display: block;
  font-size: 0.95rem;
  color: #0f172a;
}

.gst-label-text small {
  font-size: 0.8rem;
  color: #64748b;
}

/* Payment Options */
.payment-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.payment-option-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  border: 1.5px solid #0f172a;
  background: #f8fafc;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
}

.payment-option-card input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  cursor: pointer;
}

.payment-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.badge-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.badge-green {
  background: #dcfce7;
  color: #15803d;
}

/* Summary Sidebar */
.checkout-summary-sidebar {
  position: relative;
}

.summary-sticky-card {
  position: sticky;
  top: 90px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.summary-sticky-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 1.25rem 0;
  color: #0f172a;
}

.summary-products-scroll {
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 1.25rem;
  padding-right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.summary-product-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.summary-product-thumb {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  overflow: visible;
  flex-shrink: 0;
}

.summary-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.summary-qty-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-product-details {
  flex: 1;
}

.summary-product-details h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.2rem 0;
  color: #1e293b;
  line-height: 1.3;
}

.summary-product-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.summary-calculations {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1.25rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #475569;
}

.summary-row strong {
  color: #0f172a;
}

.free-shipping-text {
  color: #000000;
  font-weight: 700;
  font-size: 0.85rem;
}

.grand-total-row {
  font-size: 1.15rem;
  color: #0f172a;
  padding-top: 0.5rem;
}

.grand-total-row strong {
  font-size: 1.25rem;
  color: #0f172a;
}

.full-width-checkout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
}

.checkout-alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkout-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.checkout-trust-badges {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px dashed #cbd5e1;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #475569;
}

/* Order Success Page */
.order-success-container {
  max-width: 760px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.order-success-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.success-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #000000;
  color: #ffffff;
  margin-bottom: 1.25rem;
}

.success-eyebrow {
  color: #000000;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.5rem;
}

.order-success-card h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.75rem 0;
}

.order-success-subtitle {
  font-size: 1.05rem;
  color: #475569;
  line-height: 1.6;
  max-width: 580px;
  margin: 0 auto 2rem auto;
}

.order-receipt-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.925rem;
}

.receipt-total-row {
  border-top: 1px solid #cbd5e1;
  padding-top: 0.75rem;
  font-size: 1.1rem;
}

.order-total-amount {
  font-size: 1.25rem;
  color: #0f172a;
}

.success-action-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.button-whatsapp {
  background: #25d366;
  color: #ffffff;
  border: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.button-whatsapp:hover {
  background: #1eb956;
}

.success-trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 2rem;
  text-align: left;
}

@media (max-width: 650px) {
  .success-trust-grid {
    grid-template-columns: 1fr;
  }
}

.trust-tile h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0.5rem 0 0.25rem 0;
  color: #0f172a;
}

.trust-tile p {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

/* ==========================================================================
   Checkout layout corrections
   Global .form-field rules in globals.css carry !important, so the checkout
   restates its own spacing and control sizing at the same weight.
   ========================================================================== */
.native-checkout-layout .form-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.4rem !important;
  margin-bottom: 0 !important;
  min-width: 0;
}

.native-checkout-layout .form-field label {
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  color: #334155 !important;
}

.native-checkout-layout .form-field input,
.native-checkout-layout .form-field select,
.native-checkout-layout .form-field textarea {
  width: 100% !important;
  height: 46px !important;
  padding: 0 0.9rem !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  font-size: 0.95rem !important;
  line-height: 1.2 !important;
  color: #0f172a !important;
  background: #ffffff !important;
}

.native-checkout-layout .form-field textarea {
  height: auto !important;
  min-height: 88px !important;
  padding: 0.7rem 0.9rem !important;
  resize: vertical !important;
}

.native-checkout-layout .form-field input:focus,
.native-checkout-layout .form-field select:focus,
.native-checkout-layout .form-field textarea:focus {
  border-color: #0f172a !important;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08) !important;
}

.native-checkout-layout .form-field .input-disabled {
  background: #f1f5f9 !important;
  color: #64748b !important;
}

/* Payment option: give the label room instead of squeezing it into a column */
.payment-option-card {
  align-items: center;
  gap: 1rem;
}

.payment-option-card input[type="radio"] {
  margin-top: 0;
  flex-shrink: 0;
}

.payment-option-info {
  min-width: 0;
}

.payment-title {
  flex-wrap: wrap;
  row-gap: 0.35rem;
}

.payment-option-info p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #475569;
}

/* GST row lines up with the step cards around it */
.gst-toggle-header {
  align-items: flex-start;
}

/* Loading skeleton — keeps the page height stable while the bag is read
   from localStorage, so the checkout no longer flashes the empty state */
.checkout-skeleton-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(100deg, #f8fafc 30%, #eef2f7 50%, #f8fafc 70%);
  background-size: 220% 100%;
  animation: checkout-skeleton-shimmer 1.4s ease-in-out infinite;
}

.checkout-skeleton-card.short { height: 150px; }
.checkout-skeleton-card.tall { height: 260px; }
.checkout-skeleton-card.taller { height: 380px; }

@keyframes checkout-skeleton-shimmer {
  from { background-position: 180% 0; }
  to { background-position: -20% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .checkout-skeleton-card { animation: none; }
}

@media (max-width: 767px) {
  .native-checkout-container { margin-bottom: 2rem; }

  .checkout-step-card,
  .summary-sticky-card {
    padding: 1.15rem 1rem;
    border-radius: 10px;
  }

  .step-header { gap: 0.65rem; margin-bottom: 1rem; }
  .step-header h2 { font-size: 1.05rem; }
  .checkout-form-main { gap: 1rem; }
  .native-checkout-layout .form-field input,
  .native-checkout-layout .form-field select { height: 44px !important; }
  .summary-sticky-card { position: static; }
  .payment-option-card { padding: 0.9rem; }
}
