/**
 * Checkout virtual page — design system + layout with order summary sidebar.
 *
 * Depends on: public-design-system.css, frontend.css.
 * Loaded only when {@see \Sikshya\Frontend\Site\PublicPageUrls::isCurrentVirtualPage('checkout')}.
 *
 * @package Sikshya
 */

.sikshya-checkout-page.sik-f-scope.sikshya-public {
  padding-top: 0;
  background-color: transparent;
  min-height: 100%;
}

.sikshya-checkout-page__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  font-size: var(--sikshya-font-size-sm);
  margin-bottom: var(--sikshya-spacing-4);
  color: var(--sik-f-text-muted);
}

.sikshya-checkout-page__breadcrumb a {
  color: var(--sik-f-text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--sikshya-transition-fast);
}

.sikshya-checkout-page__breadcrumb a:hover,
.sikshya-checkout-page__breadcrumb a:focus-visible {
  color: var(--sikshya-primary);
}

.sikshya-checkout-page__breadcrumb-current {
  font-weight: 600;
  color: var(--sik-f-text-heading);
}

.sikshya-checkout-page__bc-sep {
  color: var(--sikshya-gray-400);
  user-select: none;
}

.sikshya-checkout-page__title {
  margin: 0;
  font-size: clamp(1.375rem, 2vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--sik-f-text-heading);
}

.sikshya-checkout-page__lead {
  margin: var(--sikshya-spacing-2) 0 0;
  font-size: var(--sikshya-font-size-sm);
  color: var(--sik-f-text-muted);
  line-height: 1.5;
  max-width: 40rem;
}

.sikshya-checkout-page__util-links {
  margin: var(--sikshya-spacing-3) 0 0;
  font-size: var(--sikshya-font-size-sm);
}

.sikshya-checkout-page__util-links a {
  color: var(--sikshya-primary);
  font-weight: 600;
  text-decoration: none;
}

.sikshya-checkout-page__util-links a:hover,
.sikshya-checkout-page__util-links a:focus-visible {
  text-decoration: underline;
}

.sikshya-checkout-page__body {
  width: 100%;
  max-width: var(--sikshya-public-content-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--sikshya-public-content-padding-inline);
  padding-right: var(--sikshya-public-content-padding-inline);
  padding-bottom: var(--sikshya-spacing-16);
}

.sikshya-checkout-page__empty {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(var(--sikshya-spacing-8), 5vw, var(--sikshya-spacing-10));
  text-align: left;
  border: 1px solid var(--sik-f-border);
  border-radius: var(--sik-f-radius-panel);
  background: var(--sik-f-surface);
  box-shadow: var(--sik-f-shadow-panel);
  display: grid;
  gap: var(--sikshya-spacing-6);
  align-items: center;
}

.sikshya-checkout-page__empty-illus {
  width: min(100%, 520px);
  margin: 0 auto;
}

.sikshya-checkout-page__empty-illus svg {
  width: 100%;
  height: auto;
  display: block;
}

.sikshya-checkout-page__empty-title {
  margin: 0 0 var(--sikshya-spacing-2);
  font-size: clamp(1.125rem, 1.6vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sik-f-text-heading);
}

.sikshya-checkout-page__empty-text {
  margin: 0 0 var(--sikshya-spacing-6);
  color: var(--sik-f-text-muted);
  font-size: var(--sikshya-font-size-sm);
  line-height: 1.55;
}

.sikshya-checkout-page__empty-copy {
  min-width: 0;
}

@media (min-width: 880px) {
  .sikshya-checkout-page__empty {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: clamp(var(--sikshya-spacing-6), 4vw, var(--sikshya-spacing-10));
  }
  .sikshya-checkout-page__empty-illus {
    order: 2;
    justify-self: end;
  }
}

@media (max-width: 879px) {
  .sikshya-checkout-page__empty {
    text-align: center;
  }
}

.sikshya-checkout-page__empty .sikshya-btn {
  min-height: 2.75rem;
}

.sikshya-checkout-page__empty .sikshya-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--sikshya-white), 0 0 0 4px var(--sikshya-primary-light);
}

/* Two columns: payment (main) | order summary (sidebar, right on desktop) */
.sikshya-checkout-page__layout {
  display: grid;
  gap: clamp(var(--sikshya-spacing-6), 4vw, var(--sikshya-spacing-10));
  align-items: start;
}

@media (min-width: 1024px) {
  .sikshya-checkout-page__layout {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem);
  }
}

.sikshya-checkout-page__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(var(--sikshya-spacing-4), 3vw, var(--sikshya-spacing-6));
}

.sikshya-checkout-page__sidebar {
  min-width: 0;
}

@media (min-width: 1024px) {
  .sikshya-checkout-page__sidebar {
    position: sticky;
    top: max(1rem, env(safe-area-inset-top));
    z-index: var(--sikshya-z-sticky);
  }
}

.sikshya-checkout-page__panel {
  border: 1px solid var(--sik-f-border);
  border-radius: var(--sik-f-radius-panel);
  background: var(--sik-f-surface);
  box-shadow: var(--sik-f-shadow-panel);
  padding: clamp(var(--sikshya-spacing-4), 3vw, var(--sikshya-spacing-6));
}

.sikshya-checkout-page__panel-title {
  margin: 0 0 var(--sikshya-spacing-2);
  font-size: var(--sikshya-font-size-lg);
  font-weight: 600;
  color: var(--sik-f-text-heading);
}

.sikshya-checkout-page__panel-intro {
  margin: 0 0 var(--sikshya-spacing-5);
  font-size: var(--sikshya-font-size-sm);
  color: var(--sik-f-text-muted);
  line-height: 1.5;
}

.sikshya-checkout-page__account-dl {
  margin: 0 0 var(--sikshya-spacing-4);
  padding: 0;
}

.sikshya-checkout-page__account-row {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: var(--sikshya-spacing-3);
  align-items: baseline;
  padding: var(--sikshya-spacing-2) 0;
  border-bottom: 1px solid var(--sikshya-gray-100);
  font-size: var(--sikshya-font-size-sm);
}

.sikshya-checkout-page__account-row:first-child {
  padding-top: 0;
}

.sikshya-checkout-page__account-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sikshya-checkout-page__account-row dt {
  margin: 0;
  font-weight: 600;
  color: var(--sik-f-text-muted);
}

.sikshya-checkout-page__account-row dd {
  margin: 0;
  font-weight: 500;
  color: var(--sik-f-text-heading);
  word-break: break-word;
}

.sikshya-checkout-page__account-note {
  margin: 0;
  font-size: var(--sikshya-font-size-xs);
  line-height: 1.5;
  color: var(--sik-f-text-muted);
}

.sikshya-checkout-page__coupon {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sikshya-spacing-3);
  align-items: stretch;
}

.sikshya-checkout-page__coupon-input {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0 var(--sikshya-spacing-3);
  font-size: var(--sikshya-font-size-sm);
  border: 1px solid var(--sik-f-border);
  border-radius: var(--sikshya-radius-lg);
  background: var(--sik-f-surface);
  color: var(--sik-f-text);
}

.sikshya-checkout-page__coupon-input:focus {
  outline: none;
  border-color: var(--sikshya-primary);
  box-shadow: 0 0 0 1px var(--sikshya-primary-light);
}

.sikshya-checkout-page__coupon-apply {
  flex: 0 0 auto;
  min-height: 2.75rem;
}

.sikshya-checkout-gateways {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sikshya-spacing-3);
}

@media (min-width: 480px) {
  .sikshya-checkout-gateways {
    grid-template-columns: 1fr;
  }
}

.sikshya-checkout-page__gateway-btn {
  width: 100%;
  min-height: 3.25rem;
  justify-content: flex-start;
  display: flex;
  align-items: center;
  gap: var(--sikshya-spacing-3);
  padding: var(--sikshya-spacing-3) var(--sikshya-spacing-4);
  border-radius: var(--sikshya-radius-xl);
}

.sikshya-checkout-gateways__selector {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  border: 2px solid var(--sik-f-border);
  background: var(--sik-f-surface);
  box-shadow: inset 0 0 0 4px var(--sik-f-surface);
  flex: 0 0 auto;
}

.sikshya-checkout-page__gateway-btn.is-selected .sikshya-checkout-gateways__selector {
  border-color: var(--sikshya-primary);
  box-shadow: inset 0 0 0 4px var(--sikshya-primary);
}

.sikshya-checkout-errors {
  margin-bottom: var(--sikshya-spacing-4);
  padding: var(--sikshya-spacing-4);
  border-radius: var(--sikshya-radius-xl);
  border: 1px solid rgba(244, 63, 94, 0.25);
  background: rgba(244, 63, 94, 0.08);
  color: #9f1239;
  font-size: var(--sikshya-font-size-sm);
  line-height: 1.5;
}

.sikshya-checkout-errors__title {
  margin: 0 0 var(--sikshya-spacing-2);
  font-weight: 800;
  color: #881337;
}

.sikshya-checkout-errors__text {
  margin: 0;
}

/* Guest / billing fields + embedded auth */
.sikshya-checkout-auth__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sikshya-spacing-2);
  margin-bottom: var(--sikshya-spacing-4);
}

.sikshya-checkout-auth__panel {
  margin-top: var(--sikshya-spacing-2);
}

.sikshya-checkout-auth__panel--login .sikshya-auth--login,
.sikshya-checkout-auth__panel--register .sikshya-auth--register {
  margin-top: 0;
}

.sikshya-checkout-guest {
  display: flex;
  flex-direction: column;
  gap: var(--sikshya-spacing-5);
}

.sikshya-checkout-billing {
  display: flex;
  flex-direction: column;
  gap: var(--sikshya-spacing-5);
  margin-top: var(--sikshya-spacing-6);
  padding-top: var(--sikshya-spacing-6);
  border-top: 1px solid var(--sik-f-border);
}

.sikshya-checkout-billing__title {
  margin: 0 0 var(--sikshya-spacing-2);
  font-size: var(--sikshya-font-size-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--sik-f-text-heading);
}

.sikshya-checkout-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sikshya-spacing-5);
}

@media (min-width: 520px) {
  .sikshya-checkout-form-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sikshya-spacing-5);
  }
}

/* Dynamic checkout fields (Pro add-on — markup from checkout-page.js) */
.sikshya-checkout-df {
  margin-top: var(--sikshya-spacing-6);
  padding-top: var(--sikshya-spacing-6);
  border-top: 1px solid var(--sik-f-border);
}

.sikshya-checkout-df__title {
  margin: 0 0 var(--sikshya-spacing-4);
  font-size: var(--sikshya-font-size-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--sik-f-text-heading);
}

.sikshya-checkout-df__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sikshya-spacing-5);
}

@media (min-width: 520px) {
  .sikshya-checkout-df__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sikshya-spacing-5);
  }
}

.sikshya-checkout-df__field {
  display: flex;
  flex-direction: column;
  gap: var(--sikshya-spacing-2);
  margin: 0;
  min-width: 0;
}

.sikshya-checkout-df__field--full {
  grid-column: 1 / -1;
}

.sikshya-checkout-df__help {
  margin: 0;
  font-size: var(--sikshya-font-size-xs);
  line-height: 1.5;
  color: var(--sik-f-text-muted);
}

.sikshya-checkout-df__checkbox {
  display: flex;
  gap: var(--sikshya-spacing-3);
  align-items: flex-start;
  margin: 0;
  cursor: pointer;
  font-size: var(--sikshya-font-size-sm);
  font-weight: 600;
  line-height: 1.45;
  color: var(--sik-f-text-heading);
}

.sikshya-checkout-df__checkbox-input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--sikshya-primary);
}

.sikshya-checkout-df__checkbox-text .sikshya-checkout-field__required {
  font-weight: 700;
}

.sikshya-checkout-df__radio-stack {
  display: grid;
  gap: var(--sikshya-spacing-3);
}

.sikshya-checkout-df__radio-row {
  display: flex;
  gap: var(--sikshya-spacing-3);
  align-items: flex-start;
  margin: 0;
  cursor: pointer;
  font-size: var(--sikshya-font-size-sm);
  font-weight: 500;
  line-height: 1.45;
  color: var(--sik-f-text-heading);
}

.sikshya-checkout-df__radio-row input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
  accent-color: var(--sikshya-primary);
}

.sikshya-checkout-field {
  display: flex;
  flex-direction: column;
  gap: var(--sikshya-spacing-2);
  margin: 0;
  min-width: 0;
}

.sikshya-checkout-field--full {
  grid-column: 1 / -1;
}

.sikshya-checkout-field__label {
  font-size: var(--sikshya-font-size-sm);
  font-weight: 600;
  line-height: 1.35;
  color: var(--sik-f-text-heading);
}

.sikshya-checkout-field__required {
  color: var(--sikshya-primary);
  font-weight: 700;
}

.sikshya-checkout-field__control,
.sikshya-checkout-page__main .sikshya-input.sikshya-checkout-field__control {
  width: 100%;
  max-width: 100%;
  min-height: 3rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--sik-f-border);
  border-radius: var(--sikshya-radius-lg);
  background: var(--sik-f-surface);
  color: var(--sik-f-text);
  font-size: var(--sikshya-font-size-sm);
  line-height: 1.45;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sikshya-checkout-field__control--textarea {
  min-height: 6.5rem;
  resize: vertical;
}

select.sikshya-checkout-field__control {
  cursor: pointer;
  padding-right: 2rem;
}

.sikshya-checkout-field__control:focus {
  outline: none;
  border-color: var(--sikshya-primary);
  box-shadow: 0 0 0 1px var(--sikshya-primary-light);
}

.sikshya-checkout-field__control::placeholder {
  color: var(--sik-f-text-muted);
  opacity: 0.85;
}

.sikshya-checkout-page__gateway-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
  filter: grayscale(0.1);
}

.sikshya-checkout-gateways__icon {
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  object-fit: contain;
}

.sikshya-checkout-gateways__meta {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 0.125rem;
  align-items: flex-start;
}

.sikshya-checkout-gateways__label {
  font-weight: 700;
  font-size: var(--sikshya-font-size-sm);
  color: var(--sik-f-text-heading);
}

.sikshya-checkout-gateways__hint {
  font-size: var(--sikshya-font-size-xs);
  color: var(--sik-f-text-muted);
}

.sikshya-checkout-page__gateway-btn.is-selected {
  border-color: var(--sikshya-primary-light);
  box-shadow: 0 0 0 1px var(--sikshya-primary-light);
}

.sikshya-checkout-gateway-details {
  margin-top: var(--sikshya-spacing-3);
  padding: var(--sikshya-spacing-4);
  background: var(--sik-f-surface-muted);
  border: 1px solid var(--sik-f-border);
  border-radius: var(--sikshya-radius-xl);
  font-size: var(--sikshya-font-size-sm);
  color: var(--sik-f-text);
}

.sikshya-checkout-gateway-row {
  display: flex;
  flex-direction: column;
  gap: var(--sikshya-spacing-2);
}

.sikshya-checkout-gateway-ui {
  padding: var(--sikshya-spacing-4);
  background: var(--sik-f-surface-muted);
  border: 1px solid var(--sik-f-border);
  border-radius: var(--sikshya-radius-xl);
  font-size: var(--sikshya-font-size-sm);
  color: var(--sik-f-text);
}

.sikshya-checkout-gateway-ui__title {
  margin: 0 0 var(--sikshya-spacing-2);
  font-weight: 700;
  color: var(--sik-f-text-heading);
}

.sikshya-checkout-gateway-ui__text {
  margin: 0;
  color: var(--sik-f-text-muted);
  line-height: 1.5;
}

.sikshya-checkout-gateway-details__title {
  margin: 0 0 var(--sikshya-spacing-2);
  font-weight: 700;
  color: var(--sik-f-text-heading);
}

.sikshya-checkout-gateway-details__text {
  margin: 0;
  color: var(--sik-f-text-muted);
  line-height: 1.5;
}

.sikshya-checkout-gateways__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  border: 1px solid var(--sik-f-border);
  background: var(--sik-f-surface-muted);
  color: var(--sik-f-text-muted);
}

.sikshya-checkout-page__gateway-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--sikshya-white), 0 0 0 4px var(--sikshya-primary-light);
}

.sikshya-checkout-gateways__notice {
  margin: 0;
  flex: 1 1 100%;
  padding: var(--sikshya-spacing-4);
  font-size: var(--sikshya-font-size-sm);
  line-height: 1.5;
  color: var(--sik-f-text-muted);
  background: var(--sik-f-surface-muted);
  border: 1px solid var(--sik-f-border);
  border-radius: var(--sikshya-radius-lg);
}

.sikshya-checkout-page__primary-action {
  margin-top: var(--sikshya-spacing-4);
}

.sikshya-checkout-page__primary-action .sikshya-btn {
  width: 100%;
  min-height: 2.875rem;
  font-weight: 600;
}

.sikshya-checkout-status {
  margin: var(--sikshya-spacing-5) 0 0;
  min-height: 1.25rem;
  font-size: var(--sikshya-font-size-sm);
  font-weight: 500;
  color: var(--sik-f-text);
}

.sikshya-checkout-status:not(:empty) {
  padding: var(--sikshya-spacing-3) var(--sikshya-spacing-4);
  border-radius: var(--sikshya-radius-lg);
  border: 1px solid var(--sik-f-border);
  background: var(--sik-f-surface-muted);
  color: var(--sik-f-text-heading);
}

/* Order summary (sidebar) */
.sikshya-checkout-page__summary {
  padding: var(--sikshya-spacing-5);
  box-shadow: var(--sikshya-shadow-sm);
}

.sikshya-checkout-page__summary-head {
  margin: 0 0 var(--sikshya-spacing-4);
  font-size: var(--sikshya-font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sik-f-text-muted);
}

.sikshya-checkout-page__lines {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--sik-f-border);
}

.sikshya-checkout-page__line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sikshya-spacing-2);
  padding: var(--sikshya-spacing-3) 0;
  border-bottom: 1px solid var(--sikshya-gray-100);
  font-size: var(--sikshya-font-size-sm);
  align-items: center;
}

.sikshya-checkout-page__line-thumb {
  width: 2rem;
  height: 2rem;
  border-radius: var(--sikshya-radius);
  overflow: hidden;
  background: var(--sik-f-surface-muted);
  border: 1px solid var(--sikshya-gray-200);
  flex: 0 0 auto;
}

.sikshya-checkout-page__line-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.sikshya-checkout-page__line-thumb--placeholder {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.08) 0%,
    rgba(15, 23, 42, 0.04) 100%
  );
}

.sikshya-checkout-page__line-title {
  flex: 1 1 8rem;
  min-width: 0;
  font-weight: 600;
  color: var(--sik-f-text-heading);
  line-height: 1.4;
}

.sikshya-checkout-page__line-price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--sik-f-text);
}

.sikshya-checkout-page__summary-totals {
  margin-top: var(--sikshya-spacing-4);
  padding-top: var(--sikshya-spacing-4);
  border-top: 1px solid var(--sik-f-border);
}

.sikshya-checkout-page__summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sikshya-spacing-2);
  margin-bottom: var(--sikshya-spacing-2);
  font-size: var(--sikshya-font-size-sm);
  color: var(--sik-f-text);
}

.sikshya-checkout-page__summary-row:last-of-type {
  margin-bottom: 0;
}

.sikshya-checkout-page__summary-row--discount {
  color: var(--sikshya-primary);
  font-weight: 600;
}

.sikshya-checkout-page__summary-row--discount[hidden] {
  display: none !important;
}

.sikshya-checkout-page__total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sikshya-spacing-2);
  margin-top: var(--sikshya-spacing-4);
  padding-top: var(--sikshya-spacing-4);
  border-top: 2px solid var(--sik-f-border);
}

.sikshya-checkout-page__total-label {
  font-size: var(--sikshya-font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--sik-f-text-muted);
}

.sikshya-checkout-page__total-value {
  font-size: var(--sikshya-font-size-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--sik-f-text-heading);
}

.sikshya-checkout-page__edit-cart {
  display: inline-block;
  margin-top: var(--sikshya-spacing-4);
  font-size: var(--sikshya-font-size-sm);
  font-weight: 600;
  color: var(--sikshya-primary);
  text-decoration: none;
}

.sikshya-checkout-page__edit-cart:hover,
.sikshya-checkout-page__edit-cart:focus-visible {
  text-decoration: underline;
}

@media print {
  .sikshya-checkout-gateways,
  .sikshya-checkout-status {
    display: none;
  }
}
