.cartpage {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 48px 100px;
}

.cartpage__title {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 800;
  margin: 0 0 28px;
}

.cartpage__layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px;
  align-items: start;
}

/* ===================== CART ITEMS ===================== */

.cartpage__items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-empty {
  padding: 48px 24px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 18px;
  color: rgba(0, 0, 0, 0.6);
}

.cart-empty a {
  color: #000;
  font-weight: 700;
  text-decoration: underline;
}

.cart-item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 18px;
  background: #fff;
}

.cart-item__img {
  width: 96px;
  height: 128px;
  border-radius: 12px;
  object-fit: cover;
  background: #f2f2f2;
}

.cart-item__name {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px;
}

/* ---------- pricing block (mirrors the PDP price row) ---------- */

.cart-item__pricing {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.cart-item__price-now {
  font-size: 17px;
  font-weight: 800;
  color: #000;
}

.cart-item__price-was {
  font-size: 13px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.4);
  text-decoration: line-through;
}

.cart-item__discount {
  font-size: 11px;
  font-weight: 800;
  color: #1a9850;
  background: rgba(26, 152, 80, 0.1);
  border-radius: 6px;
  padding: 3px 7px;
  letter-spacing: 0.02em;
}

.cart-item__save {
  font-size: 12.5px;
  font-weight: 700;
  color: #1a9850;
  margin-bottom: 2px;
}

.cart-item__tax {
  font-size: 11.5px;
  color: rgba(0, 0, 0, 0.45);
  margin-bottom: 12px;
}

/* ---------- selected variant chips ---------- */

.cart-item__variants {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cart-item__variant {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #000;
  background: #f5f5f5;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 6px 12px;
}

.cart-item__variant-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cart-item__stock {
  font-size: 13px;
  color: #1a9850;
  font-weight: 600;
}

.cart-item__stock.is-low {
  color: #d9720a;
}

.cart-item__qty-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.cart-item__qty-row .qty-row {
  padding: 3px;
}

.cart-item__perk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: #1a9850;
}

.cart-item__perk::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1a9850;
  /* Tick drawn with a mask so it needs no extra markup or an image. */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round' d='M6 12.5l4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round' d='M6 12.5l4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.cart-item__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  height: 100%;
  justify-content: space-between;
}

.cart-item__line {
  text-align: right;
}

.cart-item__price {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.cart-item__line-was {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.4);
  text-decoration: line-through;
  white-space: nowrap;
  margin-top: 2px;
}

.cart-item__remove {
  border: none;
  background: none;
  color: rgba(0, 0, 0, 0.5);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 200ms ease;
}

.cart-item__remove:hover {
  color: #c0392b;
}

/* ===================== ORDER SUMMARY ===================== */

.cartpage__summary {
  position: sticky;
  top: 100px;
}

.summary-card {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 18px;
  padding: 24px;
  background: #fff;
}

.summary-card__title {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 18px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 14px;
  color: rgba(0, 0, 0, 0.65);
}

.summary-row--discount,
#sum-shipping.is-free {
  color: #1a9850;
  font-weight: 700;
}

.summary-row--total {
  border-bottom: none;
  font-size: 16px;
  font-weight: 800;
  color: #000;
  padding-top: 14px;
}

.summary-savings {
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(26, 152, 80, 0.1);
  color: #1a9850;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.summary-tax {
  margin-top: 10px;
  font-size: 11.5px;
  color: rgba(0, 0, 0, 0.45);
  text-align: center;
}

.summary-card .btn-order {
  margin-top: 20px;
  margin-bottom: 0;
}

/* ===================== CHECKOUT / DELIVERY DETAILS ===================== */

.checkout {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  scroll-margin-top: 100px;
}

.checkout__title {
  font-size: clamp(28px, 3.4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #000;
  margin: 0 0 32px;
}

/* ---------- two-column layout ----------
   Form left (~55%), summary right (~45%). The divider is the form
   column's right edge, so it runs the full height of the form rather
   than stopping where the shorter summary ends. */

.checkout__layout {
  display: grid;
  grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
  align-items: start;
}

.checkout__main {
  min-width: 0;
  padding-right: 48px;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.checkout__summary {
  min-width: 0;
  padding-left: 48px;
  position: sticky;
  top: 100px;
}

.checkout__server-error:not(:empty) {
  margin-bottom: 20px;
}

/* ---------- steps: Contact / Delivery / Shipping / Payment ---------- */

.checkout-step + .checkout-step {
  margin-top: 36px;
}

.checkout-step__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #000;
  margin: 0 0 16px;
}

/* ---------- fields ---------- */

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row--3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.form-field label {
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.75);
  margin-bottom: 6px;
}

.form-optional {
  font-weight: 400;
  color: rgba(0, 0, 0, 0.4);
}

.form-field input {
  width: 100%;
  box-sizing: border-box;
  height: 50px;
  border: 1px solid #cfd3d9;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  color: #000;
  background: #fff;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.form-field input:hover {
  border-color: #9aa0a6;
}

.form-field input:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* ---------- shipping method ---------- */

.ship-method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid #000;
  border-radius: 10px;
  background: #fafafa;
  font-size: 15px;
}

.ship-method__name { font-weight: 600; }

.ship-method__price { font-weight: 700; }

.ship-method__price.is-free { color: #1a9850; }

/* ---------- order summary ---------- */

.checkout__summary-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #000;
  margin: 0 0 20px;
}

.co-lines {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.co-line {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.co-line__img {
  display: block;
  width: 64px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #f2f2f2;
}

.co-line__name {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: #000;
  overflow-wrap: anywhere;
}

.co-line__meta {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.55);
}

.co-line__price {
  text-align: right;
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
}

.co-line__was {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.4);
  text-decoration: line-through;
}

.co-empty {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.55);
}

.co-totals {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.co-totals__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 14.5px;
  color: rgba(0, 0, 0, 0.7);
}

.co-totals__row dt,
.co-totals__row dd { margin: 0; }

.co-totals__row dd { white-space: nowrap; }

#co-shipping.is-free {
  color: #1a9850;
  font-weight: 700;
}

.co-totals__row--grand {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 18px;
  font-weight: 800;
  color: #000;
}

.co-savings {
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #1a9850;
}

.co-tax {
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.45);
}

/* Only ever applied by the script once a field has actually been
   interacted with, so a pristine form is never shown in red. */
.form-field.is-invalid input {
  border-color: #c0392b;
}

.form-field.is-invalid input:focus {
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.12);
}

.form-field.is-valid input {
  border-color: #1a9850;
}

.form-field.is-valid input:focus {
  box-shadow: 0 0 0 4px rgba(26, 152, 80, 0.12);
}

.form-hint {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.45);
  margin-top: 6px;
}

.form-error {
  font-size: 13px;
  color: #c0392b;
  display: block;
}

/* Payment methods — a statement, not a choice: checkout is prepaid only
   and the method itself is picked inside Razorpay's window. */
.pay-method {
  margin: 0 0 20px;
  padding: 16px 18px 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: #fafafa;
}

.pay-method__head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  color: rgba(0, 0, 0, 0.55);
}

.pay-method__lock { flex: 0 0 auto; }

.pay-method__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pay-method__title strong {
  font-weight: 800;
  color: #000;
}

.pay-method__options {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pay-method__option {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  color: #000;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.pay-method__img {
  display: block;
  flex: 0 0 auto;
  height: 24px;
  width: auto;
}

.pay-method__img--card {
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.pay-method__option:hover {
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

@media (prefers-reduced-motion: reduce) {
  .pay-method__option { transition: none; }
}

/* Reserve the error line only once it has something to say, so empty
   fields don't carry a permanent gap under them. */
.form-field .form-error:not(:empty) {
  margin-top: 6px;
}

/* ---------- state combobox ---------- */

.combo {
  position: relative;
}

.combo-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 244px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.combo-list[hidden] {
  display: none;
}

.combo-option {
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #000;
  cursor: pointer;
}

.combo-option:hover,
.combo-option.is-active {
  background: #f2f2f2;
}

.combo-option[aria-selected="true"] {
  background: #000;
  color: #fff;
}

#place-order {
  position: relative;
  margin: 28px 0 0;
}

.checkout .pay-method {
  margin: 0;
}

#place-order.is-loading {
  color: transparent;
  pointer-events: none;
}

#place-order.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===================== ORDER SUCCESS CURTAIN ===================== */

.order-success {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  overflow: hidden;
  animation: os-curtain 260ms ease both;
}

.order-success[hidden] {
  display: none;
}

@keyframes os-curtain {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.order-success__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}

/* ---------- confetti ---------- */

.order-success__confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.os-flake {
  position: absolute;
  top: 38%;
  left: 50%;
  width: var(--w);
  height: var(--h);
  background: var(--c);
  border-radius: 1px;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: os-burst 2000ms cubic-bezier(0.2, 0.7, 0.3, 1) var(--delay) both;
}

.os-flake--dot {
  height: var(--w);
  border-radius: 50%;
}

/* Open arc — a ring with only its top-left quadrant kept. */
.os-flake--arc {
  height: var(--w);
  background: none;
  border: 3px solid var(--c);
  border-radius: 50%;
  border-bottom-color: transparent;
  border-right-color: transparent;
}

@keyframes os-burst {
  0%   { opacity: 0; transform: translate(-50%, -50%) rotate(0deg) scale(0.4); }
  12%  { opacity: 1; }
  45%  {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
               rotate(var(--rot)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx) * 1.12),
                         calc(-50% + var(--dy) + var(--fall)))
               rotate(calc(var(--rot) * 2.1)) scale(0.95);
  }
}

/* ---------- checkmark badge ---------- */

.order-success__badge {
  position: relative;
  width: 178px;
  height: 178px;
  display: grid;
  place-items: center;
  margin-bottom: 40px;
}

.order-success__halo,
.order-success__disc {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
}

.order-success__halo {
  inset: 0;
  background: #8fcfa9;
  opacity: 0.55;
  animation: os-pop 780ms cubic-bezier(0.22, 1.3, 0.36, 1) 60ms both;
}

.order-success__disc {
  inset: 17px;
  background: #22a45d;
  animation: os-pop 700ms cubic-bezier(0.22, 1.3, 0.36, 1) 160ms both;
}

@keyframes os-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.order-success__mark {
  position: relative;
  width: 118px;
  height: 118px;
  overflow: visible;
}

.order-success__mark path {
  fill: none;
  stroke: #fff;
  stroke-width: 11;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* pathLength="100" on the path, so the dash maths is just 0–100. */
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: os-draw 620ms cubic-bezier(0.6, 0, 0.2, 1) 480ms both;
}

@keyframes os-draw {
  to { stroke-dashoffset: 0; }
}

/* ---------- copy ---------- */

.order-success__title {
  font-size: clamp(24px, 3.4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #2c3a5e;
  margin: 0 0 12px;
  opacity: 0;
  animation: os-rise 520ms cubic-bezier(0.2, 0.7, 0.3, 1) 1180ms both;
}

.order-success__text {
  font-size: 15px;
  line-height: 1.55;
  color: #9ba3b7;
  margin: 0;
  max-width: 34ch;
  opacity: 0;
  animation: os-rise 520ms cubic-bezier(0.2, 0.7, 0.3, 1) 1300ms both;
}

@keyframes os-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- redirect meter ---------- */

.order-success__meter {
  width: 190px;
  height: 3px;
  margin-top: 36px;
  border-radius: 2px;
  background: rgba(44, 58, 94, 0.09);
  overflow: hidden;
  opacity: 0;
  animation: os-rise 400ms ease 1700ms both;
}

.order-success__meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: #22a45d;
  animation: os-fill 900ms linear 1780ms both;
}

@keyframes os-fill {
  to { width: 100%; }
}

/* The curtain centres its content with no scroll, so on short viewports the
   badge is scaled down rather than letting the copy run off the screen. */
@media (max-height: 660px), (max-width: 480px) {
  .order-success__badge {
    width: 132px;
    height: 132px;
    margin-bottom: 28px;
  }
  .order-success__disc { inset: 13px; }
  .order-success__mark { width: 88px; height: 88px; }
  .order-success__meter { margin-top: 26px; }
}

/* The order is already placed by the time any of this runs — the animation
   is decoration, so for reduced motion it simply resolves immediately
   rather than being replaced with some other effect. */
@media (prefers-reduced-motion: reduce) {
  .order-success,
  .order-success * {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
  }
  .os-flake { display: none; }
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 900px) {
  .cartpage { padding: 28px 24px 72px; }
  .cartpage__layout { grid-template-columns: 1fr; }
  .cartpage__summary { position: static; order: 2; }
  .cartpage__items { order: 1; }
}

@media (max-width: 560px) {
  .cart-item {
    grid-template-columns: 76px 1fr;
    grid-template-rows: auto auto;
  }
  .cart-item__img { width: 76px; height: 100px; }
  .cart-item__side {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
  }
  #place-order, .btn-order { width: 100%; }
}

/* Tablet: same two columns, tighter gutters. */
@media (max-width: 1024px) {
  .checkout__main { padding-right: 32px; }
  .checkout__summary { padding-left: 32px; }
}

/* Below the cart's own breakpoint the checkout stacks too: the form first
   (Contact, Delivery, Shipping, Payment, Pay Now), then the summary. */
@media (max-width: 900px) {
  .checkout { margin-top: 48px; padding-top: 36px; }
  .checkout__title { margin-bottom: 24px; }
  .checkout__layout { grid-template-columns: minmax(0, 1fr); }
  .checkout__main { padding-right: 0; border-right: none; }
  .checkout__summary {
    position: static;
    padding: 32px 0 0;
    margin-top: 36px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }
}

@media (max-width: 640px) {
  /* District and State share a row; Pincode takes the next one. */
  .form-row--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row--3 > .form-field:last-child { grid-column: 1 / -1; }
  /* 16px keeps iOS from zooming the viewport on focus. */
  .form-field input { font-size: 16px; }
}

@media (max-width: 380px) {
  .form-row--3 { grid-template-columns: minmax(0, 1fr); }
}

/* ===================== TERMS GATE =====================
   Sits between Pay Now and the payment window. Above Razorpay's own
   overlay is never needed — this one is always dismissed before that
   opens — but it must clear the site header, which is z-index 900. */

.tc-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tc-modal[hidden] { display: none; }

.tc-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.tc-modal__panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 32px 34px 28px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

/* Both entrance animations hang off the open state rather than the
   elements themselves. Declared directly on the panel they bind while the
   dialog is still display:none, never advance, and leave it stranded on
   the opening keyframe — visibly scaled down and overflowing the sheet.
   Scoped this way the animation starts when the modal opens, every time. */
.tc-modal:not([hidden]) .tc-modal__scrim {
  animation: tc-fade 200ms ease both;
}

.tc-modal:not([hidden]) .tc-modal__panel {
  animation: tc-rise 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tc-modal__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #000;
}

.tc-modal__lead {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.6);
}

.tc-modal__summary {
  padding: 18px 20px;
  background: #fafafa;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
}

.tc-modal__summary ul {
  margin: 0;
  padding-left: 18px;
}

.tc-modal__summary li {
  margin-bottom: 9px;
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.78);
}

.tc-modal__summary li:last-child { margin-bottom: 0; }

.tc-modal__more {
  margin: 14px 0 0;
  padding-top: 13px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 13px;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.55);
}

.tc-modal__more a {
  display: inline-block;
  margin-top: 2px;
  color: #000;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tc-modal__check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 20px 0 22px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.tc-modal__check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: #000;
  cursor: pointer;
}

.tc-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.tc-modal__btn {
  padding: 13px 22px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, opacity 180ms ease;
}

.tc-modal__btn--ghost {
  background: #fff;
  color: rgba(0, 0, 0, 0.66);
  border: 1px solid rgba(0, 0, 0, 0.16);
}

.tc-modal__btn--ghost:hover { background: #f4f4f4; color: #000; }

.tc-modal__btn--primary {
  min-width: 170px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
}

.tc-modal__btn--primary:hover:not(:disabled) { background: #1a1a1a; }

/* Disabled until the box is ticked — the gate is the whole point, so it
   must read as unavailable rather than merely inert. */
.tc-modal__btn--primary:disabled {
  background: rgba(0, 0, 0, 0.18);
  border-color: transparent;
  color: rgba(255, 255, 255, 0.9);
  cursor: not-allowed;
}

.tc-modal__btn--primary.is-loading {
  color: transparent;
  pointer-events: none;
  position: relative;
}

.tc-modal__btn--primary.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tc-spin 620ms linear infinite;
}

.tc-modal__error {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 600;
  color: #b3261e;
}

.tc-modal__error[hidden] { display: none; }

@keyframes tc-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tc-rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes tc-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .tc-modal:not([hidden]) .tc-modal__scrim,
  .tc-modal:not([hidden]) .tc-modal__panel { animation: none; }
}

@media (max-width: 640px) {
  .tc-modal { padding: 0; align-items: flex-end; }

  .tc-modal__panel {
    max-width: none;
    max-height: 92vh;
    padding: 26px 22px 22px;
    /* Rises from the bottom edge on a phone, so the sheet reads as
       attached to the screen rather than floating mid-air. */
    border-radius: 22px 22px 0 0;
  }

  .tc-modal__actions { flex-direction: column-reverse; }
  .tc-modal__btn { width: 100%; padding: 15px 22px; }
}
