/* checkout-style.css — checkout page styles, modeled on the GlamTrend reference.
   Tokens come from tokens.css. Layout primitives (.page-wrap, .form-control base,
   .btn base) come from style.css and Bootstrap 5.
   Structure:
     .leftCheckoutPanel         flex row, edge-to-edge
       .checkout-row             55%, white, form column
         .checkout-section       max-width centered inner
       .price-row                45%, gray rail to viewport edge, summary column
         .order-summary          inner content
   At <992px the columns stack and the gray rail wraps under the form. */

/* ---------- Layout: row + columns ---------- */

.leftCheckoutPanel {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
  margin: 0;
}

.checkout-row,
.price-row {
  display: flex;
  align-items: flex-start;
  box-sizing: border-box;
}

.checkout-row {
  flex: 0 0 55%;
  max-width: 55%;
  justify-content: flex-end;
  background: var(--color-background);
  padding: 1.25rem 0;
}

.price-row {
  flex: 0 0 45%;
  max-width: 45%;
  justify-content: flex-start;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  padding: 2.5rem 0;
  min-height: 100vh;
}

.checkout-section {
  width: 100%;
  max-width: 600px;
  padding: 0 1.25rem;
}

.order-summary {
  width: 100%;
  max-width: 460px;
  padding: 0 1.5rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

/* Sticky desktop summary */
@media (min-width: 992px) {
  .order-summary {
    position: sticky;
    top: 2rem;
  }
}

/* Stack at lg breakpoint */
@media (max-width: 991.98px) {
  .checkout-row,
  .price-row {
    flex: 0 0 100%;
    max-width: 100%;
    justify-content: center;
    min-height: 0;
  }
  .price-row {
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 0;
  }
  .checkout-section,
  .order-summary { max-width: 640px; }
}

/* ---------- Header ---------- */

.checkout-header {
  padding: 0 0 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.checkout-header .brand-logo {
  max-height: 40px;
  width: auto;
  display: block;
}

.checkout-header .brand-name {
  font-size: 1.05rem;
  color: var(--color-text);
}

.secure-connection {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-success);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.secure-connection .bi-lock-fill { font-size: 0.95rem; }

@media (max-width: 480px) {
  .secure-connection .label-text { display: none; }
}

/* ---------- Urgency banner ---------- */

.urgency-banner {
  background: linear-gradient(90deg, #ffe5cc 0%, #ffd4a8 50%, #ffe5cc 100%);
  color: #5a2a0e;
  text-align: center;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  letter-spacing: 0.02em;
  margin: 0 0 1.5rem 0;
}
.urgency-banner .limited-stock {
  color: #c14215;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.urgency-banner [data-countdown] {
  font-weight: 700;
  color: #c14215;
  font-variant-numeric: tabular-nums;
}

/* ---------- Step headings ---------- */

.step-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  margin: 1.5rem 0 1rem;
  color: var(--color-text);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-text);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex: 0 0 26px;
}

/* ---------- Form controls ---------- */

.form-floating > .form-control,
.form-floating > .form-select {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: #fff;
  color: var(--color-text);
  font-size: 16px;
  min-height: calc(3.25rem + 2px);
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.form-floating > label { color: var(--color-text-muted); }

.payment-field { position: relative; }

.cvv-tooltip,
.field-payment-icons {
  position: absolute;
  top: 50%;
  right: 0.95rem;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 1rem;
  cursor: help;
  pointer-events: auto;
  z-index: 5;
}

/* ---------- Shipping method options ---------- */

.shipping-options {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.shipping-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  min-height: 64px;
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.shipping-row:last-child { border-bottom: none; }

.shipping-row .form-check-input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  flex: 0 0 auto;
  cursor: pointer;
}
.shipping-row .form-check-input:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.shipping-row .form-check-label {
  flex: 1 1 auto;
  margin: 0;
  cursor: pointer;
}

.shipping-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.shipping-info { flex: 1 1 auto; min-width: 0; }
.shipping-name { font-weight: 500; color: var(--color-text); }
.shipping-days { font-size: 0.82rem; color: var(--color-text-muted); margin-top: 2px; }
.shipping-price { font-weight: 600; color: var(--color-text); white-space: nowrap; }

.shipping-row:has(.form-check-input:checked) {
  background: var(--color-primary-light);
  box-shadow: inset 0 0 0 1px var(--color-primary);
}

/* ---------- Payment options ---------- */

.payment-options {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.payment-option { position: relative; }

.payment-option > .form-check-input {
  position: absolute;
  top: 1.1rem;
  left: 1rem;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  z-index: 1;
  cursor: pointer;
}
.payment-option > .form-check-input:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.payment-option > .form-check-label {
  display: block;
  margin: 0;
  cursor: pointer;
}

.payment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1rem 1rem 2.7rem;
}

.payment-title { font-weight: 500; color: var(--color-text); }

.payment-icons {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: wrap;
}
.pay-icon {
  height: 22px;
  width: auto;
  display: block;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--color-border);
}

.payment-details {
  padding: 1.25rem;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.payment-option:has(.form-check-input:checked) {
  box-shadow: inset 0 0 0 1px var(--color-primary);
}

/* ---------- Billing-address block (shown when bill_same is unchecked) ---------- */

.billing-address {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--color-border);
}
.checkout-substep-heading {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0;
}

/* ---------- Pay button ---------- */

.btn-pay {
  height: 58px;
  background: var(--color-primary);
  color: var(--color-primary-text);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-button);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: filter 0.1s ease-in-out;
}
.btn-pay:hover  { filter: brightness(0.92); color: var(--color-primary-text); }
.btn-pay:active { filter: brightness(0.85); }
.btn-pay:disabled { filter: grayscale(0.4) brightness(0.95); cursor: not-allowed; }

/* ---------- Fine print ---------- */

.fine-print {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.fine-print a {
  color: var(--color-text-muted);
  text-decoration: underline;
}
.fine-print a:hover { color: var(--color-text); }

/* ---------- Order summary: product line ---------- */

.product-list { padding-bottom: 0.5rem; }

.product-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 0.5rem;
}

.product-image-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.product-image {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: block;
  background: var(--color-surface);
}

.badge-quantity {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--color-text);
  color: #fff;
  border: 2px solid var(--color-surface);
  border-radius: 999px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.product-details {
  flex: 1 1 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.product-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.3;
}

.product-variant {
  margin-top: 2px;
  line-height: 1.35;
}
.product-variant:empty { display: none; }

.product-price {
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

/* ---------- Discount / coupon ---------- */

.discount-section {
  width: 100%;
  margin: 1.5rem 0 0.5rem;
}

.discount-section .discount-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.discount-section .form-control {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  padding: 0 0.85rem;
  line-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: #fff;
  font-size: 0.95rem;
}

.btn-apply-discount {
  flex: 0 0 auto;
  height: 46px;
  padding: 0 1.25rem;
  background: var(--color-text);
  color: #fff;
  border: 1px solid var(--color-text);
  border-radius: var(--radius-button);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.btn-apply-discount:hover {
  background: #000;
  border-color: #000;
  color: #fff;
  filter: none;
}

.applied-coupon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.6rem 0 0;
  color: var(--color-success);
  font-weight: 600;
  font-size: 0.85rem;
}
.applied-coupon .bi-check-circle-fill { font-size: 1rem; }
.applied-coupon .remove-coupon {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--color-success);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 0.25rem;
}
.applied-coupon .remove-coupon:hover { color: var(--color-error); }

[data-coupon-feedback] {
  display: block;
  margin-top: 0.4rem;
}
[data-coupon-feedback]:empty { display: none; }
[data-coupon-feedback].ok    { color: var(--color-success); }
[data-coupon-feedback].error { color: var(--color-error); }

/* ---------- Cost breakdown ---------- */

.cost-breakdown {
  font-size: 0.95rem;
  margin-top: 1rem;
}
.cost-breakdown .grand-total {
  border-top: 1px solid var(--color-border);
  margin-top: 0.5rem !important;
}
.cost-breakdown .grand-total-value {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}
.cost-breakdown .currency-code {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

/* ---------- Reviews block ---------- */

.reviews-block {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.reviews-block .reviews-header {
  text-align: center;
  font-weight: 700;
  color: var(--color-text);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}

.review-item {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.6rem;
}

.review-item .review-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.review-item .stars {
  color: #f5a623;
  letter-spacing: 1px;
}

.review-item .reviewer-name {
  font-weight: 700;
  color: var(--color-text);
  font-size: 0.82rem;
}

.review-item .verified {
  color: var(--color-success);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.review-item .review-quote {
  color: #444;
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 0;
  font-style: italic;
}

/* ---------- Social proof: live + rating ---------- */

.trust-shell {
  margin: 1.5rem auto 0;
  max-width: 460px;
  background: #fff;
  padding: 1.25rem;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.live-proof {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #fff5f0;
  border: 1px solid #ffd9c4;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  color: #5a2a0e;
}
.live-proof strong { color: #c14215; font-weight: 700; }

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff5722;
  flex: 0 0 9px;
  box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.7);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(255, 87, 34, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 87, 34, 0); }
}

.rating-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.rating-bar .stars     { color: #f5a623; font-size: 1rem; letter-spacing: 1px; }
.rating-bar .rating-num  { font-weight: 700; color: var(--color-text); font-size: 0.9rem; }
.rating-bar .rating-meta { color: var(--color-text-muted); font-size: 0.82rem; }

/* ---------- Guarantee row ---------- */

.guarantee-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: linear-gradient(135deg, #fff8e6 0%, #fff 60%);
  border: 1px solid #ffd966;
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.guarantee-seal {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, #fbbf24 0%, #d97706 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.65rem;
  text-align: center;
  line-height: 1.05;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
  border: 3px solid #fff;
  outline: 2px solid #d97706;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.guarantee-seal .big   { font-size: 1.25rem; line-height: 1; margin-bottom: 2px; }
.guarantee-seal .small { font-size: 0.55rem; }

.guarantee-text {
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.45;
}
.guarantee-text strong { display: block; color: var(--color-text); font-size: 0.92rem; margin-bottom: 2px; }
.guarantee-text p { margin: 0; color: var(--color-text-muted); font-size: 0.82rem; line-height: 1.4; }

/* ---------- Trust card grid ---------- */

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.trust-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.85rem 0.5rem;
  text-align: center;
}

.trust-card .icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  margin: 0 auto 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.trust-card.shipping .icon-circle { background: #e7f5ff; color: #1971c2; }
.trust-card.secure   .icon-circle { background: #e6f7ed; color: #0e9f5a; }
.trust-card.support  .icon-circle { background: #f3e8ff; color: #7c3aed; }

.trust-card .label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.25;
  display: block;
}
.trust-card .sub {
  font-size: 0.66rem;
  color: var(--color-text-muted);
  margin-top: 3px;
  display: block;
  line-height: 1.3;
}

/* ---------- Why-choose block ---------- */

.why-block {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.why-block h6 {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text);
  margin: 0 0 0.6rem;
  text-align: center;
}

.why-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.why-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.45rem 0;
  font-size: 0.82rem;
  color: var(--color-text);
  border-top: 1px dashed var(--color-border);
}
.why-list li:first-child { border-top: 0; }
.why-list .check {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-success);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  margin-top: 1px;
}
.why-list strong { color: var(--color-text); font-weight: 700; }

/* ---------- Footer links ---------- */

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--color-text);
  text-decoration: underline;
}

/* ---------- Mobile-only top order summary bar ---------- */

.mobile-summary-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
}

.mobile-summary {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

.mobile-summary > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--color-text);
  font-size: 0.95rem;
}
.mobile-summary > summary::-webkit-details-marker { display: none; }

.mobile-summary .ms-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-primary);
  font-weight: 600;
}
.mobile-summary .ms-toggle .bi-cart3 { font-size: 1.05rem; }
.mobile-summary .ms-toggle .ms-chevron {
  transition: transform 0.18s ease;
  font-size: 0.85rem;
  opacity: 0.7;
}
.mobile-summary[open] .ms-toggle .ms-chevron { transform: rotate(180deg); }

.mobile-summary .ms-total {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.mobile-summary .ms-body {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
}
.mobile-summary .ms-line {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0;
}
.mobile-summary .ms-grand {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

/* ---------- Small-screen layout polish ---------- */

@media (max-width: 991.98px) {
  .checkout-row     { padding: 1rem 0 1.5rem; }
  .price-row        { padding: 1.5rem 0 2rem; }
  .checkout-section,
  .order-summary    { padding: 0 1rem; max-width: 720px; }

  .checkout-header  { padding-bottom: 0.85rem; margin-bottom: 0.85rem; }
  .checkout-header .brand-logo { max-height: 32px; }
  .checkout-header .brand-name { font-size: 0.95rem; }

  .urgency-banner   { font-size: 0.85rem; padding: 0.55rem 0.85rem; }
  .step-heading     { font-size: 0.95rem; margin: 1.25rem 0 0.85rem; }
  .step-num         { width: 24px; height: 24px; font-size: 0.75rem; flex: 0 0 24px; }

  .btn-pay          { height: 56px; font-size: 1rem; }

  .order-summary    { padding-top: 0.5rem; }
}

@media (max-width: 575px) {
  .checkout-section { padding: 0 0.9rem; }
  .order-summary    { padding: 0 0.9rem; }
  .trust-row        { gap: 0.4rem; }
  .trust-card       { padding: 0.65rem 0.35rem; }
  .trust-card .icon-circle { width: 32px; height: 32px; font-size: 0.95rem; }
  .trust-card .label { font-size: 0.65rem; }
  .trust-card .sub   { font-size: 0.6rem; }

  .product-image,
  .product-image-wrap { width: 56px; height: 56px; }
  .product-image    { border-radius: 10px; }

  .guarantee-seal   { flex: 0 0 72px; width: 72px; height: 72px; }
  .guarantee-seal .big { font-size: 1.05rem; }
  .guarantee-seal .small { font-size: 0.5rem; }

  .review-item      { padding: 0.6rem 0.7rem; }
  .review-item .review-quote { font-size: 0.8rem; }

  .why-block        { padding: 0.7rem 0.85rem; }
  .why-list li      { font-size: 0.78rem; }
}
