/* ── Variables ─────────────────────────────────────── */
:root {
  --accent: #3ea8ff;
  --bg: #0b0b0b;
  --cursor-default: url("assets/cursors/moga-black.cur"), auto;
  --cursor-link: url("assets/cursors/moga-black-link.cur"), pointer;
  --page-bg:
    radial-gradient(ellipse 85% 60% at 50% -10%, rgba(62, 168, 255, .08) 0%, transparent 65%),
    linear-gradient(180deg, #0f0f0f 0%, #0b0b0b 100%);
  --text: #e8e8e8;
  --text-muted: #888;
  --radius: 8px;
  --detail-back-gap: 1.5rem;
  --surface: rgba(255, 255, 255, .06);
  --surface-border: rgba(255, 255, 255, .14);
  --glass-blur: 16px;
  --glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    0 10px 30px rgba(5, 10, 18, .45);
  --glass-shine: linear-gradient(120deg, rgba(255, 255, 255, .23), rgba(255, 255, 255, .03) 42%, rgba(255, 255, 255, .11));
  --checkout-bg:
    radial-gradient(120% 80% at 50% -10%, rgba(62, 168, 255, .16) 0%, rgba(62, 168, 255, .06) 36%, rgba(10, 14, 18, .92) 72%),
    rgba(10, 14, 18, .92);
  --checkout-inner-bg: rgba(255, 255, 255, .02);
  --checkout-item-border: rgba(255, 255, 255, .08);
  --checkout-divider: rgba(255, 255, 255, .08);
  --checkout-input-bg: rgba(255, 255, 255, .03);
}

/* ── Reset ────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  cursor: var(--cursor-default);
  -webkit-font-smoothing: antialiased;
  transition: background .75s cubic-bezier(.22, 1, .36, 1), color .55s cubic-bezier(.22, 1, .36, 1);
}

@media (min-width: 901px) {
  body {
    transition: padding-right .25s ease, background .75s cubic-bezier(.22, 1, .36, 1), color .55s cubic-bezier(.22, 1, .36, 1);
  }

  body.cart-open {
    padding-right: min(430px, calc(100vw - 1.5rem));
  }

  body.cart-open::after {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(430px, calc(100vw - 1.5rem));
    /* Прозрачный слой: справа видны те же эффекты фона, что и на всей странице. */
    background: transparent;
    z-index: 1;
    pointer-events: none;
  }
}

body[data-theme="light"] {
  --bg: #eef2f6;
  --cursor-default: url("assets/cursors/moga-white.cur"), auto;
  --cursor-link: url("assets/cursors/moga-white-link.cur"), pointer;
  --page-bg:
    radial-gradient(ellipse 110% 72% at 50% -8%, rgba(86, 174, 255, .22) 0%, rgba(86, 174, 255, .07) 42%, transparent 74%),
    linear-gradient(180deg, #f5f8fc 0%, #edf2f7 48%, #e9eff5 100%);
  --text: #213140;
  --text-muted: #6a7a8a;
  --surface: rgba(255, 255, 255, .62);
  --surface-border: rgba(96, 160, 255, .28);
  --glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .58),
    0 10px 28px rgba(62, 132, 210, .18);
  --glass-shine: linear-gradient(125deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .24) 44%, rgba(255, 255, 255, .42));
  --checkout-bg:
    radial-gradient(120% 85% at 50% -12%, rgba(86, 174, 255, .28) 0%, rgba(86, 174, 255, .12) 40%, rgba(255, 255, 255, .95) 78%),
    rgba(255, 255, 255, .95);
  --checkout-inner-bg: rgba(255, 255, 255, .78);
  --checkout-item-border: rgba(33, 49, 64, .12);
  --checkout-divider: rgba(33, 49, 64, .12);
  --checkout-input-bg: rgba(255, 255, 255, .92);
  background: var(--page-bg);
}

a,
button,
.card,
.detail__card,
.detail__period,
.detail__buy,
.cart__remove,
.theme-toggle,
.hero-support,
.cart-fab,
.checkout__close {
  cursor: var(--cursor-link);
}

.bg-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: .85;
}

.hero__bg,
.catalog__bg,
.card,
.detail__card,
.theme-toggle,
.detail__back,
.btn {
  transition-property: background, border-color, color, box-shadow, transform, opacity;
  transition-duration: .55s, .45s, .45s, .35s, .25s, .25s;
  transition-timing-function: cubic-bezier(.22, 1, .36, 1);
}

/* ── Hero ─────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  text-align: center;
}

.theme-toggle {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  backdrop-filter: blur(8px);
  transition: transform .18s ease, border-color .2s ease, background .2s ease, color .2s ease;
  animation: floatSoft 4s ease-in-out infinite;
}

.hero-support {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: transform .18s ease, border-color .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}

.hero-support svg {
  width: 19px;
  height: 19px;
}

.hero-support:hover {
  transform: translateY(-2px);
  border-color: rgba(62, 168, 255, .45);
  box-shadow: 0 0 20px rgba(62, 168, 255, .2);
}

.theme-toggle:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(62, 168, 255, .45);
}

.theme-toggle svg {
  position: absolute;
  width: 19px;
  height: 19px;
  transition: opacity .2s ease, transform .2s ease;
}

.theme-toggle__sun {
  opacity: 0;
  transform: scale(.85);
}

body[data-theme="light"] .theme-toggle__sun {
  opacity: 1;
  transform: scale(1);
}

body[data-theme="light"] .theme-toggle__moon {
  opacity: 0;
  transform: scale(.85);
}

/* smooth bridge between hero and catalog */
/* subtle radial gradient behind content */
.hero__bg {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 0;
}

body[data-theme="light"] .hero__bg {
  background: transparent;
}

/* ── Particles canvas ─────────────────────────────── */
.hero__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Cursor glow ──────────────────────────────────── */
.hero__cursor-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62, 168, 255, .07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  translate: -50% -50%;
  opacity: 0;
  transition: opacity .4s;
  will-change: left, top;
}

.hero__cursor-glow.active {
  opacity: 1;
}

/* ── Floating orbs ────────────────────────────────── */
.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .06;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.hero__orb--1 {
  width: 350px;
  height: 350px;
  background: var(--accent);
  top: 10%;
  left: 15%;
  animation: orbDrift1 14s ease-in-out infinite alternate;
}

.hero__orb--2 {
  width: 260px;
  height: 260px;
  background: #a78bfa;
  bottom: 15%;
  right: 10%;
  animation: orbDrift2 18s ease-in-out infinite alternate;
}

.hero__orb--3 {
  width: 200px;
  height: 200px;
  background: var(--accent);
  top: 55%;
  left: 60%;
  animation: orbDrift3 12s ease-in-out infinite alternate;
}

@keyframes orbDrift1 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, 40px) scale(1.12); }
  100% { transform: translate(-30px, 70px) scale(.95); }
}

@keyframes orbDrift2 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-50px, -30px) scale(1.08); }
  100% { transform: translate(40px, -60px) scale(.92); }
}

@keyframes orbDrift3 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(35px, -45px) scale(1.1); }
  100% { transform: translate(-45px, 25px) scale(.97); }
}

/* soft accent glow at the bottom */
.hero__glow {
  position: absolute;
  bottom: -120px;
  left: 50%;
  translate: -50% 0;
  width: 600px;
  height: 260px;
  background: radial-gradient(closest-side, rgba(62, 168, 255, .12), transparent);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  padding: 2rem 1.5rem;
}

/* ── Brand name ───────────────────────────────────── */
.hero__brand {
  font-size: clamp(3.2rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1;
  color: var(--text);
  margin-bottom: .15rem;
}

.hero__shop {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
}

/* ── Badge ────────────────────────────────────────── */
.hero__badge {
  display: inline-block;
  padding: .35em 1em;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(62, 168, 255, .3);
  border-radius: 999px;
  margin-bottom: 1.5rem;
}

/* ── Title ────────────────────────────────────────── */
.hero__title {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.hero__title .accent {
  color: var(--accent);
}

/* ── Subtitle ─────────────────────────────────────── */
.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

/* ── Buttons ──────────────────────────────────────── */
.hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .85em 2em;
  font-size: .95rem;
  font-weight: 600;
  border-radius: 14px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow);
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}

.btn:active {
  transform: scale(.97);
}

.btn--primary {
  background:
    linear-gradient(145deg, rgba(116, 201, 255, .28), rgba(62, 168, 255, .22)),
    var(--surface);
  color: #fff;
  border: 1px solid rgba(116, 201, 255, .45);
}

.btn--primary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    0 14px 32px rgba(62, 168, 255, .32);
  border-color: rgba(138, 211, 255, .72);
}

.btn--hero-catalog {
  padding: 1.05em 2.8em;
  font-size: 1.08rem;
  font-weight: 700;
}

.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, .15);
}

.btn--outline:hover {
  border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .04);
}

/* ── Appear animation ─────────────────────────────── */
.anim {
  opacity: 0;
  transform: translateY(28px);
  animation: fadeUp .7s ease forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Catalog ──────────────────────────────────────── */
.catalog {
  position: relative;
  overflow: hidden;
}

.catalog__bg {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 0;
}

body[data-theme="light"] .catalog__bg {
  background: transparent;
}

.catalog__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.catalog__cursor-glow {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62, 168, 255, .06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  translate: -50% -50%;
  opacity: 0;
  transition: opacity .4s;
  will-change: left, top;
}

.catalog__cursor-glow.active {
  opacity: 1;
}

.catalog__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .05;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.catalog__orb--1 {
  width: 300px;
  height: 300px;
  background: var(--accent);
  top: 15%;
  right: 10%;
  animation: catalogOrb1 16s ease-in-out infinite alternate;
}

.catalog__orb--2 {
  width: 240px;
  height: 240px;
  background: #a78bfa;
  bottom: 10%;
  left: 8%;
  animation: catalogOrb2 20s ease-in-out infinite alternate;
}

@keyframes catalogOrb1 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-40px, 30px) scale(1.1); }
  100% { transform: translate(30px, -50px) scale(.93); }
}

@keyframes catalogOrb2 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(45px, -35px) scale(1.08); }
  100% { transform: translate(-25px, 40px) scale(.95); }
}

.catalog__glow-top {
  position: absolute;
  top: -100px;
  left: 50%;
  translate: -50% 0;
  width: 600px;
  height: 220px;
  background: radial-gradient(closest-side, rgba(62, 168, 255, .1), transparent);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.catalog__glow-bottom {
  position: absolute;
  bottom: -100px;
  left: 50%;
  translate: -50% 0;
  width: 500px;
  height: 200px;
  background: radial-gradient(closest-side, rgba(167, 139, 250, .08), transparent);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.catalog__inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 1.5rem;
}

.catalog__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 3rem;
  letter-spacing: -0.02em;
}

.catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ── Card ─────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease, background .3s ease;
  cursor: pointer;
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow);

  opacity: 0;
  transform: translateY(32px);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(240px circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(112, 198, 255, .2), transparent 62%),
    var(--glass-shine);
  transition: opacity .18s ease;
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity .5s ease var(--reveal-delay, 0s),
    transform .5s ease var(--reveal-delay, 0s),
    box-shadow .18s ease,
    border-color .18s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .25),
    0 14px 36px rgba(62, 168, 255, .2),
    0 3px 10px rgba(0, 0, 0, .35);
  border-color: rgba(138, 211, 255, .38);
  background: rgba(255, 255, 255, .09);
}

.card:hover::after {
  opacity: 1;
}

.card.visible:hover {
  transform: translateY(-6px);
}

.card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(62, 168, 255, .08);
  color: var(--accent);
  flex-shrink: 0;
  margin-bottom: .25rem;
}

.card__icon svg {
  width: 22px;
  height: 22px;
}

.card__name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.card__desc {
  font-size: .92rem;
  line-height: 1.55;
  color: var(--text-muted);
  flex-grow: 1;
}

.card__price {
  display: inline-block;
  margin-top: .5rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .02em;
}

/* ── Detail (focus mode) ─────────────────────────── */
.catalog--focus {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.catalog--focus .catalog__inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.detail {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .35s ease, transform .35s ease;
  padding-top: 0;
}

.detail.active,
.detail.leaving {
  display: flex;
}

.detail.active {
  opacity: 1;
  transform: translateY(0);
}

.detail.leaving {
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
}

.detail__back {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: none;
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--text-muted);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 500;
  padding: .55em 1.2em;
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
  margin-top: 0;
  margin-bottom: var(--detail-back-gap);
  align-self: flex-start;
}

.detail__back svg {
  width: 18px;
  height: 18px;
}

.detail__back:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .04);
}

.detail__header {
  margin-bottom: 2rem;
}

.detail__badge {
  display: inline-block;
  padding: .35em 1em;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(62, 168, 255, .3);
  border-radius: 999px;
  margin-bottom: .75rem;
}

.detail__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: .04em;
  margin-bottom: .35rem;
}

.detail__subtitle {
  font-size: clamp(.9rem, 1.8vw, 1.05rem);
  color: var(--text-muted);
  line-height: 1.5;
}

.detail__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
}

.detail__grid--single {
  grid-template-columns: minmax(420px, 640px);
  justify-content: center;
}

/* ── Detail card ─────────────────────────────────── */
.detail__card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  padding: 2.25rem 1.75rem 1.75rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  cursor: pointer;
  transition:
    transform .42s cubic-bezier(.22, 1, .36, 1),
    box-shadow .42s cubic-bezier(.22, 1, .36, 1),
    border-color .42s cubic-bezier(.22, 1, .36, 1),
    background .42s cubic-bezier(.22, 1, .36, 1);
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow);
}

.detail__card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(230px circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(62, 168, 255, .2), transparent 62%),
    var(--glass-shine);
  transition: opacity .32s cubic-bezier(.22, 1, .36, 1);
}

.detail__card:hover {
  transform: translateY(-4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .24),
    0 12px 34px rgba(62, 168, 255, .2),
    0 3px 8px rgba(0, 0, 0, .32);
  border-color: rgba(138, 211, 255, .36);
  background: rgba(255, 255, 255, .09);
}

.detail__card:hover::after {
  opacity: 1;
}

.detail__card.selected {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px var(--accent),
    0 8px 32px rgba(62, 168, 255, .15),
    0 2px 8px rgba(0, 0, 0, .4);
  background: rgba(255, 255, 255, .1);
}

.detail__card.selected::after {
  opacity: 1;
}

.detail__card-popular {
  position: absolute;
  top: -1px;
  right: 1.5rem;
  background: var(--accent);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3em 1em .35em;
  border-radius: 0 0 8px 8px;
}

.detail__card-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.detail__card-desc {
  font-size: .92rem;
  line-height: 1.55;
  color: var(--text-muted);
  flex-grow: 1;
}

/* ── Period toggle ───────────────────────────────── */
.detail__toggle {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, .04);
  border-radius: 8px;
  padding: 4px;
  margin-top: .5rem;
}

.detail__period {
  flex: 1;
  padding: .65em 1em;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: color .2s, background .2s;
}

.detail__period:hover {
  color: var(--text);
}

.detail__period.active {
  background: rgba(62, 168, 255, .15);
  color: var(--accent);
}

/* ── Card footer (price + buy) ───────────────────── */
.detail__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.detail__price-block {
  display: flex;
  flex-direction: column;
}

.detail__cost {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  transition: opacity .15s;
}

.detail__per {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
  min-height: 1em;
}

.detail__buy {
  padding: .7em 1.6em;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(116, 201, 255, .25), rgba(62, 168, 255, .2)),
    var(--surface);
  border: 1px solid rgba(116, 201, 255, .45);
  border-radius: var(--radius);
  cursor: pointer;
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}

.detail__buy:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .26),
    0 12px 28px rgba(62, 168, 255, .32);
  border-color: rgba(138, 211, 255, .72);
}

.detail__buy:active {
  transform: scale(.96);
}

/* ── Detail cascade animation ────────────────────── */
.detail__anim {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .55s ease, transform .55s ease;
  transition-delay: var(--delay, 0s);
}

.detail.active .detail__anim {
  opacity: 1;
  transform: translateY(0);
}

/* ── Hide grid/title in focus mode ───────────────── */
.catalog__grid.hidden {
  display: none;
}

.catalog__title.hidden {
  display: none;
}

/* ── Checkout / cart ─────────────────────────────── */
.checkout {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 30;
  width: min(420px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--checkout-bg);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, .28),
    0 2px 10px rgba(62, 168, 255, .12);
  transform: translateX(calc(100% + 1.25rem));
  opacity: 0;
  pointer-events: none;
  transition: transform .25s ease, opacity .25s ease;
}

.checkout.checkout--open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.cart-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 31;
  border: 1px solid rgba(116, 201, 255, .45);
  border-radius: 999px;
  padding: .75rem 1.1rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(116, 201, 255, .28), rgba(62, 168, 255, .22)),
    var(--surface);
  cursor: pointer;
  backdrop-filter: blur(var(--glass-blur));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .24),
    0 10px 30px rgba(62, 168, 255, .35);
}

.cart-fab:hover {
  box-shadow: 0 12px 32px rgba(62, 168, 255, .45);
}

.checkout__inner {
  padding: 1rem;
}

.checkout__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: 1rem;
}

.checkout__title {
  font-size: 1.25rem;
}

.checkout__close {
  border: 1px solid var(--surface-border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.checkout__close:hover {
  color: var(--text);
}

.checkout__layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart,
.checkout-form {
  background: var(--checkout-inner-bg);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 1rem;
}

.cart__items {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-height: 120px;
}

.cart__empty {
  color: var(--text-muted);
}

.cart__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .65rem;
  padding: .75rem;
  border: 1px solid var(--checkout-item-border);
  border-radius: 10px;
}

.cart__item-name {
  font-weight: 600;
}

.cart__item-meta {
  color: var(--text-muted);
  font-size: .85rem;
}

.cart__remove {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .85rem;
}

.cart__remove:hover {
  color: #ff7d7d;
}

.cart__total-row {
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--checkout-divider);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart__clear {
  margin-top: .6rem;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, .03);
  color: var(--text-muted);
  border-radius: 8px;
  width: 100%;
  padding: .6rem .8rem;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  transition: color .2s, border-color .2s, background .2s, opacity .2s;
}

.cart__clear:hover:not(:disabled) {
  color: #ff9a9a;
  border-color: rgba(255, 125, 125, .5);
  background: rgba(255, 125, 125, .08);
}

.cart__clear:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.checkout-form__title {
  margin-bottom: .3rem;
}

.checkout-form__label {
  font-size: .9rem;
  color: var(--text-muted);
}

.checkout-form__input {
  width: 100%;
  border: 1px solid var(--surface-border);
  background: var(--checkout-input-bg);
  color: var(--text);
  border-radius: 8px;
  padding: .75rem .85rem;
  font: inherit;
}

.checkout-form__textarea {
  resize: vertical;
  min-height: 104px;
  line-height: 1.45;
}

.checkout-form__input:focus {
  outline: none;
  border-color: rgba(62, 168, 255, .55);
  box-shadow: 0 0 0 3px rgba(62, 168, 255, .16);
}

.checkout-instructions {
  margin-top: .25rem;
  padding-top: .8rem;
  border-top: 1px solid var(--checkout-divider);
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.checkout-instructions__title {
  font-weight: 700;
}

.checkout-instructions__list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.checkout-instructions__item {
  border: 1px solid var(--checkout-item-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .02);
  overflow: hidden;
}

.checkout-instructions__item > summary {
  list-style: none;
  padding: .75rem .8rem;
  cursor: pointer;
  font-weight: 650;
  color: var(--text);
}

.checkout-instructions__item > summary::-webkit-details-marker {
  display: none;
}

.checkout-instructions__body {
  padding: .75rem .8rem .9rem;
  border-top: 1px solid var(--checkout-divider);
  color: var(--text-muted);
  font-size: .92rem;
  line-height: 1.55;
}

.checkout-instructions__body a {
  color: var(--accent);
  text-decoration: none;
}

.checkout-instructions__body a:hover {
  text-decoration: underline;
}

.checkout-instructions__code {
  display: block;
  margin-top: .5rem;
  padding: .65rem .75rem;
  border-radius: 10px;
  border: 1px solid var(--checkout-item-border);
  background: rgba(0, 0, 0, .25);
  color: var(--text);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .86rem;
}

.checkout-instructions__body ol {
  margin: .5rem 0 0 1.15rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.checkout-form__submit {
  margin-top: .5rem;
}

.checkout-form__status {
  min-height: 1.2em;
  font-size: .9rem;
  color: var(--text-muted);
}

.checkout-form__status.is-success {
  color: #55d18c;
}

.checkout-form__status.is-error {
  color: #ff7d7d;
}

/* ── Responsive tweaks ────────────────────────────── */
@media (max-width: 900px) {
  .detail__grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .checkout {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    max-height: calc(100vh - 6rem);
  }
}

@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
  }

  .catalog__inner {
    padding: 4rem 1rem;
  }

  .catalog__grid {
    grid-template-columns: 1fr;
  }

  .detail__grid {
    grid-template-columns: 1fr;
  }

  .catalog--focus .catalog__inner {
    min-height: auto;
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
}
