/* =========================================================
   RESET & BASE
   ========================================================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--color-page-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Montserrat', sans-serif;
  color: var(--color-text-main);
  background: var(--gradient-page);
  transition:
    background 0.3s ease,
    color 0.3s ease;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1.15;
}

h3 {
  font-size: 1.12rem;
}

/* =========================================================
   LAYOUT UTILITIES
   ========================================================= */

.container {
  width: min(calc(100% - 24px), var(--container));
  margin: 0 auto;
}

.stack-lg > * + * {
  margin-top: 28px;
}
.stack-md > * + * {
  margin-top: 22px;
}
.stack-sm > * + * {
  margin-top: 14px;
}

.section {
  padding: 24px 0;
}

.section--accent {
  padding-bottom: 42px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--color-accent-secondary) 6%, transparent),
    color-mix(in srgb, var(--color-accent-main) 8%, transparent)
  );
}

.section--quick-order .order-form {
  max-width: 720px;
}

.section-title {
  text-align: center;
}

.section-title > * + * {
  margin-top: 10px;
}

.section-title--light span,
.section-title--light p {
  color: var(--color-text-soft);
}

.lead,
.section-title p,
.card p,
.spec-row span,
.footer-brand p {
  color: var(--color-text-soft);
  line-height: 1.7;
}

.eyebrow,
.section-title span {
  display: inline-block;
  color: var(--color-accent-secondary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

/* =========================================================
   SHARED CARD SURFACE
   ========================================================= */

.hero-card,
.card,
.spec-list,
.order-form,
.gallery-viewport {
  background: var(--gradient-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}

.hero-card,
.order-form,
.spec-list,
.card {
  padding: 22px;
}

.brand__backdrop,
.hero-card,
.card,
.spec-list,
.order-form,
.gallery-viewport,
.toast {
  box-shadow: var(--shadow-soft);
}

/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: var(--color-topbar-bg);
  border-bottom: 1px solid var(--color-line-main);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--color-accent-secondary) 8%, transparent);
}

.topbar__wrap,
.footer__wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 80px;
}

/* --- Brand --- */

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand__backdrop {
  width: 74px;
  height: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 22px;
  padding: 8px;
  border: 1px solid var(--color-line);
}

.brand__backdrop--sm {
  width: 60px;
  height: 60px;
  border-radius: 18px;
}

.brand__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand__text strong,
.footer-brand strong {
  display: block;
  font-size: 1rem;
}

.brand__text small {
  color: var(--color-text-soft);
}

/* --- Nav --- */

.nav {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: var(--color-text-soft);
  font-weight: 600;
}

.nav a {
  position: relative;
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: var(--gradient-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav a:hover::after {
  transform: scaleX(1);
}

/* =========================================================
   HERO
   ========================================================= */

.hero {
  padding-top: 30px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background:
    radial-gradient(
      circle at top right,
      color-mix(in srgb, var(--color-accent-secondary) 18%, transparent),
      transparent 24%
    ),
    radial-gradient(circle at top left, color-mix(in srgb, var(--color-accent-main) 14%, transparent), transparent 20%),
    var(--gradient-card);
}

.hero-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 25%);
}

.hero-offer {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--color-accent-main) 8%, transparent),
    color-mix(in srgb, var(--color-accent-secondary) 12%, transparent)
  );
  border: 1px solid var(--color-line-main);
}

.hero-offer__badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  background: var(--gradient-accent);
  box-shadow: 0 10px 20px color-mix(in srgb, var(--color-accent-main) 22%, transparent);
}

.hero-media {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  padding: 18px;
  border-radius: 26px;
  background: var(--gradient-accent-soft);
  border: 1px solid var(--color-line);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.hero-media img {
  display: block;
  width: min(100%, 360px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #fff;
  border-radius: 26px;
  padding: 10px;
  box-shadow: var(--shadow-soft);
}

.mini-row,
.cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-points,
.price-box.mini-row {
  gap: 14px;
}

.cards-row--3 > * {
  flex: 1 1 240px;
}

/* =========================================================
   PRICE BOX
   ========================================================= */

.price-box {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 18px;
  justify-content: center;
  min-width: 50%;
}

.price-box__label {
  display: inline-block;
  text-align: center;
  color: var(--color-accent-main);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}

.price-old,
.price-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 66px;
  padding: 10px 20px;
  border-radius: 999px;
}

.price-old {
  color: var(--color-price-old-text);
  background: var(--color-pill-bg);
  border: 1px dashed var(--color-price-old-border);
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: line-through;
  animation: oldPricePulse 2.8s ease-in-out infinite;
}

.price-new {
  color: var(--color-price-new-text);
  background: var(--gradient-price-new);
  box-shadow: var(--shadow-strong);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  animation: newPricePop 1.9s ease-in-out infinite;
}

/* =========================================================
   STOCK PILL & TIMER
   ========================================================= */

.stock-pill,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--color-pill-bg);
  border: 1px solid var(--color-line);
}

.stock-pill {
  color: var(--color-stock);
  font-weight: 700;
}

.stock-pill.is-low {
  animation: stockBlink 1.2s ease-in-out infinite;
  background: color-mix(in srgb, var(--color-accent-main) 12%, var(--color-pill-bg));
  border-color: color-mix(in srgb, var(--color-accent-main) 40%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent-main) 10%, transparent);
}

.stock-pill-counter {
  padding-inline: 5px;
}

.timer-box {
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--color-card-bg) 92%, transparent),
    color-mix(in srgb, var(--color-card-bg-soft) 95%, transparent)
  );
  border: 1px solid var(--color-line);
}

.timer-box h3 {
  margin-bottom: 12px;
  text-align: center;
}

.timer {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.timer > div {
  min-width: 116px;
  padding: 18px 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  background: var(--color-pill-bg);
  border: 1px solid var(--color-line);
  box-shadow: 0 10px 20px color-mix(in srgb, var(--color-accent-secondary) 8%, transparent);
}

.timer strong {
  display: block;
  font-size: 2.25rem;
  color: var(--color-accent-secondary);
  transition:
    transform 0.18s ease,
    opacity 0.18s ease;
}

.timer strong.tick {
  transform: translateY(-2px) scale(1.08);
}

.timer span {
  color: var(--color-text-soft);
  font-size: 0.95rem;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 56px;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--gradient-accent);
  color: var(--color-text-on-accent-main);
  box-shadow: var(--shadow-button);
}

.btn--primary:hover {
  filter: saturate(1.05) brightness(1.02);
}

.floating-buy {
  background: var(--gradient-accent);
  color: #ffffff;
  box-shadow: var(--shadow-button);
}

.floating-buy:hover {
  filter: saturate(1.05) brightness(1.02);
}

.btn--full {
  width: 100%;
}

.btn--send {
  margin-top: 16px;
}

.btn--pulse {
  animation: ctaPulse 1.9s ease-in-out infinite;
}

/* =========================================================
   CARDS
   ========================================================= */

.card__icon,
.step-badge {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--gradient-accent-soft);
  margin-bottom: 16px;
  font-size: 1.35rem;
  border: 1px solid var(--color-line);
}

.step-badge {
  color: var(--color-text-on-accent);
  background: var(--gradient-step);
  font-weight: 800;
}

/* =========================================================
   GALLERY
   ========================================================= */

.gallery-slider {
  position: relative;
}

.gallery-viewport {
  overflow: hidden;
}

.gallery-track {
  display: flex;
  transition: transform 0.35s ease;
  touch-action: pan-y;
}

.gallery-slide {
  min-width: 100%;
  padding: 0;
  margin: 0;
}

.gallery-slide img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--color-line);
  background: var(--color-pill-bg);
  color: var(--color-text-soft);
  font-size: 2rem;
  cursor: pointer;
  z-index: 2;
}

.gallery-btn--prev {
  left: 10px;
}

.gallery-btn--next {
  right: 10px;
}

.gallery-btn:hover {
  transform: translateY(-50%) scale(1.06);
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.gallery-dots button {
  width: 12px;
  height: 12px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: color-mix(in srgb, var(--color-accent-secondary) 20%, transparent);
}

.gallery-dots button.is-active {
  background: var(--color-accent-main);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--color-accent-main) 12%, transparent);
}

/* =========================================================
   SPEC LIST
   ========================================================= */

.spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-line);
}

.spec-row:last-child {
  border-bottom: 0;
}

/* =========================================================
   VIDEO
   ========================================================= */

.video-frame {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.22),
    0 0 0 3px rgba(255, 255, 255, 0.6);
  background: #000;
  flex-shrink: 0;
}

.video-frame video {
  display: block;
  width: 280px;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 28px;
}

/* =========================================================
   ORDER FORM
   ========================================================= */

.order-form {
  max-width: 620px;
  margin: 0 auto;
  position: relative;
}

.order-form label {
  display: block;
}

.order-form label + label,
.order-form label + button,
.order-form button + * {
  margin-top: 16px;
}

.order-form span {
  margin-bottom: 8px;
  font-weight: 600;
}

.order-form input {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--color-line);
  background: var(--color-input-bg);
  color: var(--color-text-main);
}

.order-form input::placeholder {
  color: color-mix(in srgb, var(--color-text-soft-main) 72%, white 28%);
}

.order-form input.has-error {
  border-color: var(--color-error, #dc2626);
}

.field-error {
  display: block;
  min-height: 1.2em;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-error, #dc2626);
  opacity: 0;
  transition: opacity 0.2s;
}

.field-error.is-visible {
  opacity: 1;
}

.order-form__trap {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.order-form__turnstile {
  display: block;
  margin-top: 20px;
}

.order-form .cf-turnstile iframe {
  max-width: 100%;
}

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
  border-top: 1px solid var(--color-line);
  background: color-mix(in srgb, var(--color-card-bg) 72%, transparent);
}

.footer-link {
  color: var(--color-accent-secondary);
  font-weight: 700;
}

/* =========================================================
   TOAST
   ========================================================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: 15px;
  transform: translateX(-50%) translateY(20px);
  min-width: min(96vw, 420px);
  padding: 18px;
  border-radius: 24px;
  background: #ffffff;
  color: var(--color-text);
  border: 1px solid var(--color-line);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  z-index: 100;
}

.toast.success {
  background-color: var(--color-green);
  color: var(--color-on-success);
}

.toast.warning {
  background-color: var(--color-yellow);
  color: var(--color-on-warning);
}

.toast.error {
  background-color: var(--color-pink-strong);
  color: #ffffff;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================
   FLOATING BUY
   ========================================================= */

.floating-buy {
  position: fixed;
  left: 50%;
  bottom: 9px;
  z-index: 30;
  transform: translateX(-50%) translateY(120%);
  width: min(calc(100% - 20px), 420px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 14px 18px;
  border-radius: 31px;
  color: #fff;
  opacity: 0;
  transition:
    transform 0.24s ease,
    opacity 0.24s ease;
}

.floating-buy strong {
  font-size: 1.1rem;
}

.floating-buy.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* =========================================================
   BACK TO TOP
   ========================================================= */

.back-to-top {
  display: none;
  position: fixed;
  left: 12px;
  bottom: 80px;
  z-index: 30;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--color-line);
  background: var(--color-pill-bg);
  color: var(--color-text-soft);
  font-size: 1.4rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  pointer-events: none;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 820px) {
  .back-to-top {
    display: flex;
  }
}

/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes ctaPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes newPricePop {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes oldPricePulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.9;
  }

  50% {
    transform: translateY(-2px);
    opacity: 1;
  }
}

@keyframes stockBlink {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-accent-main) 10%, transparent);
  }

  50% {
    box-shadow: 0 0 0 10px transparent;
  }
}

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

@media (max-width: 820px) {
  .topbar__wrap,
  .footer__wrap {
    min-height: auto;
    padding: 12px 0;
    flex-direction: column;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-link {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(calc(100% - 16px), var(--container));
  }

  .hero-card,
  .order-form,
  .spec-list,
  .card {
    padding: 18px;
  }

  .hero-media {
    flex-direction: column;
    align-items: center;
  }

  .hero-offer {
    padding: 14px;
  }

  .step-card,
  .feature-card {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .step-card .step-badge,
  .feature-card .card__icon {
    flex-shrink: 0;
    margin-bottom: 0;
  }

  .step-card__content,
  .feature-card__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mini-row,
  .price-box {
    flex-direction: column;
  }

  .price-box {
    align-items: stretch;
    width: 100%;
    min-width: unset;
    padding: 12px 0 0;
  }

  .price-old,
  .price-new {
    width: 100%;
  }

  .spec-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .gallery-btn {
    width: 42px;
    height: 42px;
  }

  .timer > div {
    min-width: 92px;
  }

  .video-frame video {
    width: 100%;
    max-width: 320px;
  }

  .floating-buy {
    min-height: 58px;
    padding: 12px 16px;
    font-size: 0.92rem;
  }
}
