.checkout-page {
  background:
    radial-gradient(circle at top right, rgba(174, 138, 105, 0.18), transparent 24%),
    radial-gradient(circle at bottom left, rgba(17, 17, 17, 0.09), transparent 22%),
    linear-gradient(180deg, #faf7f3 0%, #f4ece4 40%, #eee3d8 100%);
}

.checkout-shell {
  padding-bottom: 2.5rem;
}

.checkout-header {
  margin-bottom: 1rem;
}

.checkout-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  gap: 1rem;
  align-items: start;
}

.checkout-panel {
  position: relative;
  overflow: hidden;
  padding: 1.35rem;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.checkout-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 35%);
  pointer-events: none;
}

.checkout-hero {
  grid-column: 1 / -1;
  display: grid;
  gap: 1.25rem;
}

.checkout-hero__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}

.checkout-hero__copy {
  max-width: 52rem;
}

.checkout-hero h1 {
  max-width: 11ch;
  margin: 0;
  color: var(--brand);
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.checkout-hero p {
  max-width: 60ch;
  margin: 0.95rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.72;
}

.checkout-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 0.82rem;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.checkout-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.checkout-metric {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.7));
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.checkout-metric span {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.65rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
}

.checkout-metric strong,
.checkout-panel__head h2,
.checkout-panel__head h3,
.checkout-panel__head h1 {
  margin: 0;
  color: var(--brand);
  letter-spacing: -0.04em;
}

.checkout-metric strong {
  font-size: 1.08rem;
}

.checkout-metric p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.checkout-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.checkout-panel__head--compact {
  margin-bottom: 0.75rem;
}

.summary-count {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.62rem 0.85rem;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.05);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.summary-count strong {
  color: var(--brand);
}

.checkout-form {
  display: grid;
  gap: 1rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.45rem;
  color: var(--brand);
  font-weight: 700;
}

.field span {
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(174, 138, 105, 0.14);
}

.payment-block {
  display: grid;
  gap: 0.85rem;
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.payment-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 152px;
  padding: 1rem;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.payment-card:hover,
.payment-card:focus-within {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(17, 17, 17, 0.18);
}

.payment-card input {
  accent-color: var(--brand);
}

.payment-card strong {
  color: var(--brand);
  font-size: 1rem;
}

.payment-card span {
  color: var(--muted);
  line-height: 1.6;
}

.checkout-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 0.8rem;
}

.checkout-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.summary-panel {
  position: sticky;
  top: 1rem;
}

.summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-link {
  display: inline-flex;
  align-items: center;
  padding: 0.56rem 0.8rem;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.06);
  color: var(--brand);
  font-weight: 700;
}

.checkout-items {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 42vh;
  overflow: auto;
  padding-right: 0.1rem;
}

.checkout-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
}

.checkout-item__art {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--tone-a), var(--tone-b));
  position: relative;
  overflow: hidden;
}

.checkout-item__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  filter: saturate(0.96) contrast(1.02);
  opacity: 0.95;
}

.checkout-item__art::before {
  content: "";
  position: absolute;
  inset: 14% 16% auto auto;
  width: 45%;
  height: 45%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.checkout-item h4 {
  margin: 0;
  color: var(--brand);
  font-size: 1rem;
  line-height: 1.25;
}

.checkout-item__meta {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.checkout-item__meta--secondary {
  margin-top: 0.15rem;
  font-size: 0.8rem;
}

.summary-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.checkout-costs {
  display: grid;
  gap: 0.7rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(17, 17, 17, 0.08);
}

.checkout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}

.checkout-row strong {
  color: var(--brand);
}

.checkout-row--total {
  padding-top: 0.35rem;
  color: var(--brand);
  font-size: 1.08rem;
  font-weight: 800;
}

.checkout-shipping-note {
  margin: 1rem 0 0;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(17, 17, 17, 0.05);
  color: var(--muted);
  line-height: 1.7;
}

.summary-panel .button {
  margin-top: 1rem;
}

.checkout-empty {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px dashed rgba(17, 17, 17, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  line-height: 1.65;
}

body[dir="rtl"] .checkout-header__actions,
body[dir="rtl"] .summary-top,
body[dir="rtl"] .checkout-panel__head,
body[dir="rtl"] .checkout-hero__top {
  flex-direction: row-reverse;
}

body[dir="rtl"] .checkout-badges {
  justify-content: flex-start;
}

body[dir="rtl"] .checkout-row,
body[dir="rtl"] .summary-count {
  flex-direction: row-reverse;
}

@media (max-width: 1100px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .summary-panel {
    position: static;
  }
}

@media (max-width: 840px) {
  .checkout-hero__top,
  .checkout-metrics,
  .field-grid,
  .payment-grid,
  .checkout-actions {
    grid-template-columns: 1fr;
  }

  .checkout-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .checkout-panel {
    padding: 1rem;
    border-radius: 26px;
  }

  .checkout-item {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .summary-item-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}
