/* Quenta Cart — order-form-only overrides.
   The client area's quenta.css is already on the page (cart.php uses the
   active client template's header.tpl). This file fills the gaps: cart-step
   indicator, product comparison grid, billing-cycle pill switch. */

/* ---------- Step indicator (configure → review → checkout → done) ------- */

.cart-steps {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 2.5rem;
  padding: 0;
  list-style: none;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-ink-400);
  flex-wrap: wrap;
}
.cart-steps li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.cart-steps li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in oklch, white 12%, transparent);
}
.cart-steps li.is-active {
  color: white;
}
.cart-steps li.is-active::before {
  background: var(--color-brand-blue-lit);
  box-shadow: 0 0 12px var(--color-brand-blue-lit);
}
.cart-steps li.is-done {
  color: var(--color-ink-200);
}
.cart-steps li.is-done::before {
  background: var(--color-brand-blue);
}
.cart-steps li + li::after {
  content: "";
  position: absolute;
}
.cart-steps li:not(:last-child) {
  position: relative;
  padding-right: 1.25rem;
}
.cart-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 0.75rem;
  height: 1px;
  background: color-mix(in oklch, white 12%, transparent);
  transform: translateY(-50%);
}

/* ---------- Billing cycle pill switch ------------------------------------ */

.cycle-switch {
  display: inline-flex;
  padding: 4px;
  background: color-mix(in oklch, white 4%, transparent);
  border: 1px solid color-mix(in oklch, white 8%, transparent);
  border-radius: 999px;
  margin: 0 auto 2.5rem;
}
.cycle-switch button {
  border: 0;
  background: transparent;
  color: var(--color-ink-300);
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    color 0.3s ease,
    background 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cycle-switch button.is-active {
  background: linear-gradient(
    120deg,
    var(--color-brand-blue-lit),
    var(--color-brand-blue) 60%,
    var(--color-brand-red)
  );
  color: white;
}
.cycle-switch .save-badge {
  font-size: 10px;
  letter-spacing: 0.16em;
  margin-left: 0.4rem;
  opacity: 0.7;
}

/* ---------- Cart summary table ------------------------------------------ */

.cart-summary {
  display: grid;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 960px) {
  .cart-summary {
    grid-template-columns: minmax(0, 1fr) 22rem;
  }
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  padding: 1.5rem 0;
  border-bottom: 1px solid color-mix(in oklch, white 6%, transparent);
}
.cart-line:last-child {
  border-bottom: 0;
}
.cart-line h4 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.cart-line .meta {
  font-size: 13px;
  color: var(--color-ink-400);
  margin: 0;
}
.cart-line .line-price {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  text-align: right;
  white-space: nowrap;
}
.cart-line .line-actions {
  margin-top: 0.5rem;
  font-size: 12px;
}
.cart-line .line-actions a {
  color: var(--color-ink-400);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklch, white 20%, transparent);
}
.cart-line .line-actions a:hover {
  color: white;
}

.cart-totals {
  position: sticky;
  top: 8rem;
  padding: 1.5rem;
  border-radius: var(--radius-edge);
  border: 1px solid color-mix(in oklch, white 8%, transparent);
  background: color-mix(in oklch, white 3%, transparent);
}
.cart-totals dl {
  margin: 0;
  display: grid;
  gap: 0.625rem;
}
.cart-totals .row {
  display: flex;
  justify-content: space-between;
  font-size: 14.5px;
  color: var(--color-ink-200);
}
.cart-totals .row.total {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in oklch, white 8%, transparent);
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.01em;
  color: white;
}

/* ---------- Domain option cards (configureproductdomain.tpl) ------------ */
/* The "Choose your domain" step renders one selectable card per enabled
   WHMCS option: register / transfer / use-your-own / sub-domain. They are
   mutually exclusive radios (name="domainchoice"); the checked card is lit. */

.domain-option-cards {
  display: grid;
  gap: 0.875rem;
  margin-top: 1.5rem;
}
.domain-option-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 1.25rem 1.5rem;
  border: 1px solid color-mix(in oklch, white 10%, transparent);
  border-radius: var(--radius-edge);
  background: color-mix(in oklch, white 3%, transparent);
  cursor: pointer;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}
.domain-option-card:hover {
  border-color: color-mix(in oklch, white 18%, transparent);
}
/* .is-selected is set by the order-form JS; :has() is the no-JS fallback. */
.domain-option-card.is-selected,
.domain-option-card:has(input[type="radio"]:checked) {
  border-color: color-mix(in oklch, var(--color-brand-blue-lit) 55%, transparent);
  background: color-mix(in oklch, var(--color-brand-blue-lit) 8%, transparent);
  box-shadow: 0 0 0 1px
    color-mix(in oklch, var(--color-brand-blue-lit) 40%, transparent);
}
.domain-option-card.has-error {
  border-color: color-mix(in oklch, var(--color-brand-red) 60%, transparent);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--color-brand-red) 45%, transparent);
}
.domain-error {
  margin: 1rem 0 0;
  color: #fca5a5;
  font-size: 14px;
}
.domain-option-card > input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0.2rem 0 0;
  flex: none;
  accent-color: var(--color-brand-blue-lit);
  cursor: pointer;
}
.domain-option-body {
  min-width: 0;
}
.domain-option-body h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--color-ink-50);
}

/* ---------- Configure domains ------------------------------------------ */

.nameserver-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 720px) {
  .nameserver-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Promo code row ---------------------------------------------- */

.promo-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.promo-row input {
  flex: 1;
}

/* ---------- Empty state ------------------------------------------------- */

.cart-empty {
  text-align: center;
  padding: 5rem 1rem;
  border-radius: var(--radius-edge);
  border: 1px dashed color-mix(in oklch, white 12%, transparent);
}
.cart-empty p {
  color: var(--color-ink-300);
  margin: 0 0 1.5rem;
}

/* ---------- Domain checker (search + inline AJAX results) --------------- */

.domain-mode-tabs {
  display: inline-flex;
  gap: 0;
  background: color-mix(in oklch, white 3%, transparent);
  border: 1px solid color-mix(in oklch, white 10%, transparent);
  border-radius: 999px;
  padding: 0.25rem;
}
.domain-mode-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--color-ink-300);
  text-decoration: none;
  border-radius: 999px;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}
.domain-mode-tab.is-active {
  background: color-mix(in oklch, white 10%, transparent);
  color: white;
}
.domain-mode-tab:hover:not(.is-active) {
  color: white;
}

.domain-results {
  padding: 1.5rem;
  border-radius: var(--radius-edge);
  background: color-mix(in oklch, white 3%, transparent);
  border: 1px solid color-mix(in oklch, white 8%, transparent);
}
.domain-status {
  margin: 0;
  font-size: 1.125rem;
  color: var(--color-ink-200);
}
.domain-status.is-available {
  color: #4ade80;
}
.domain-status.is-unavailable,
.domain-status.is-tld-unavailable,
.domain-status.is-invalid {
  color: #fca5a5;
}
.domain-status .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in oklch, white 20%, transparent);
  border-top-color: var(--color-brand-blue-lit);
  border-radius: 999px;
  animation: q-spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 0.5rem;
}
@keyframes q-spin {
  to {
    transform: rotate(360deg);
  }
}

.domain-add-action {
  margin-top: 1rem;
}

/* "Contact Us" button shown when the searched domain is unavailable.
   Without this it sits flush against the status paragraph above. */
#primaryLookupResult {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.domain-contact-support {
  display: inline-flex;
  align-items: center;
}

.domain-suggestions {
  padding-top: 1rem;
  border-top: 1px solid color-mix(in oklch, white 6%, transparent);
}
.domain-suggestion {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.25rem;
  border-bottom: 1px solid color-mix(in oklch, white 4%, transparent);
}
.domain-suggestion:last-child {
  border-bottom: 0;
}
.domain-suggestion-name {
  flex: 1;
  color: var(--color-ink-100);
  font-family: var(--font-display);
}
.domain-suggestion-price {
  color: var(--color-ink-300);
  font-size: 14px;
  min-width: 6rem;
  text-align: right;
}

.w-hidden {
  display: none;
}
