:root {
  --pay-bg: #071117;
  --pay-surface: rgba(12, 28, 34, 0.92);
  --pay-surface-soft: rgba(19, 45, 52, 0.72);
  --pay-line: rgba(190, 231, 222, 0.18);
  --pay-text: #e9f3f1;
  --pay-muted: #9eb5b2;
  --pay-accent: #65d4bc;
  --pay-accent-dark: #071b17;
  --pay-error: #ff978d;
  --pay-radius: 3px;
}

html { background: var(--pay-bg); }

body {
  display: block;
  min-height: 100dvh;
  padding: 0;
  background:
    linear-gradient(90deg, rgba(5, 14, 19, .96) 0%, rgba(5, 14, 19, .73) 48%, rgba(5, 14, 19, .36) 100%),
    url('../images/astral/hero-night.jpg') center / cover fixed no-repeat;
  color: var(--pay-text);
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  align-items: initial;
  justify-content: initial;
}

body::before {
  z-index: 0;
  opacity: .25;
  background-image:
    radial-gradient(circle at 20% 22%, #d9fff6 0 1px, transparent 1.5px),
    radial-gradient(circle at 76% 13%, #d9fff6 0 1px, transparent 1.5px),
    radial-gradient(circle at 65% 66%, #d9fff6 0 1px, transparent 1.5px);
  background-size: 270px 250px, 340px 300px, 230px 260px;
  pointer-events: none;
}

.pay-topbar {
  position: relative;
  z-index: 3;
  height: 72px;
  padding: 0 max(24px, 4vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--pay-line);
  background: rgba(7, 17, 23, .8);
  backdrop-filter: blur(18px);
}

.pay-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--pay-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2em;
  text-decoration: none;
}

.pay-brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(101, 212, 188, .65);
  transform: rotate(45deg);
}

.pay-brand-mark::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid var(--pay-accent);
}

.back-home {
  color: var(--pay-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color .2s;
}

.back-home:hover,
.back-home:focus-visible { color: var(--pay-accent); }

.content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 48px));
  max-width: none;
  min-height: calc(100dvh - 72px);
  margin: 0 auto;
  padding: 76px 0 38px;
}

.store-intro {
  max-width: 720px;
  margin-bottom: 44px;
}

.store-kicker {
  margin: 0 0 15px;
  color: var(--pay-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.store-intro h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(42px, 5.5vw, 72px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.045em;
}

.store-intro > p:last-child {
  max-width: 600px;
  margin: 20px 0 0;
  color: var(--pay-muted);
  font-size: 16px;
}

.store-panel {
  border: 1px solid var(--pay-line);
  background: var(--pay-surface);
  box-shadow: 0 30px 90px rgba(0, 8, 11, .34);
  backdrop-filter: blur(20px);
}

.content > header {
  display: block;
  margin: 0;
  padding: 30px;
  border-bottom: 1px solid var(--pay-line);
}

.logo { display: none !important; }

.step-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 20px;
}

.step-heading span {
  color: var(--pay-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.step-heading h2 {
  margin: 0;
  color: var(--pay-text);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.015em;
}

.search-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  width: 100%;
  align-items: start;
}

.search-box-wrapper { gap: 10px; }
.search-box { width: 100%; gap: 10px; }

.search-input-container {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--pay-line);
  border-radius: var(--pay-radius);
  background: rgba(4, 14, 18, .62);
  background-image: none;
  transition: border-color .2s, box-shadow .2s;
}

.search-input-container:focus-within {
  border-color: var(--pay-accent);
  box-shadow: 0 0 0 3px rgba(101, 212, 188, .12);
}

.search-box input {
  width: 100%;
  min-height: 52px;
  padding: 0 17px;
  border: 0;
  border-radius: 0;
  color: var(--pay-text);
  background: transparent;
  font-size: 15px;
}

.search-box input::placeholder { color: #809795; opacity: 1; }

.search-box button {
  width: auto;
  min-width: 126px;
  height: 52px;
  margin: 0;
  padding: 0 22px;
  border: 1px solid var(--pay-accent);
  border-radius: var(--pay-radius);
  color: var(--pay-accent-dark);
  background: var(--pay-accent);
  background-image: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.search-box button:hover {
  opacity: 1;
  transform: translateY(-2px);
  background: #83e2cd;
}

.search-box button:active { transform: scale(.98); }

.search-message {
  min-height: 0;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--pay-radius);
  text-align: left;
  font-size: 13px;
}

.search-message.success {
  border-color: rgba(101, 212, 188, .45);
  color: #91e6d3;
  background: rgba(101, 212, 188, .1);
}

.search-message.error {
  border-color: rgba(255, 151, 141, .5);
  color: var(--pay-error);
  background: rgba(255, 151, 141, .09);
}

.search-message.warning {
  border-color: rgba(232, 200, 112, .45);
  color: #e8c870;
  background: rgba(232, 200, 112, .09);
}

.user-info,
.user-info.active {
  min-width: 230px;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--pay-line);
  border-radius: var(--pay-radius);
  background: var(--pay-surface-soft);
  backdrop-filter: blur(10px);
}

.user-info { display: none; }
.user-info.active { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.user-info p { margin: 0; color: var(--pay-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.user-info p span { display: block; margin-top: 2px; color: var(--pay-text); font-size: 15px; text-transform: none; letter-spacing: 0; }
.user-info .user-diamonds { color: var(--pay-accent); }

.content > main { display: grid; grid-template-columns: minmax(0, 1fr); }

.products-section { min-width: 0; padding: 30px; border-bottom: 1px solid var(--pay-line); }
.products-container { margin: 0; padding: 0 42px; }

.products-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(205px, 1fr);
  gap: 14px;
  padding: 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.product-card {
  flex: none;
  min-height: 302px;
  padding: 16px;
  border: 1px solid var(--pay-line);
  border-radius: var(--pay-radius);
  background: linear-gradient(155deg, rgba(29, 61, 67, .82), rgba(8, 22, 27, .94));
  background-image: none;
  box-shadow: none;
  scroll-snap-align: start;
  transition: transform .25s, border-color .25s, background .25s;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(101, 212, 188, .48);
  box-shadow: none;
}

.product-card.selected {
  border-color: var(--pay-accent);
  background: linear-gradient(155deg, rgba(33, 84, 76, .88), rgba(9, 28, 31, .96));
  box-shadow: inset 0 0 0 1px rgba(101, 212, 188, .25);
}

.product-card.selected::after {
  content: "Selected";
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 8px;
  color: var(--pay-accent-dark);
  background: var(--pay-accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.product-image { height: 150px; margin-bottom: 8px; }
.product-image img { width: 100%; height: 100%; object-fit: contain; filter: saturate(.8) drop-shadow(0 16px 24px rgba(0, 0, 0, .28)); }
.diamonds { margin: 0; color: var(--pay-text); font-size: 25px; font-weight: 600; letter-spacing: -.03em; }
.diamonds::after { content: " gems"; color: var(--pay-muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.product-content { margin-top: auto; }
.price-container { margin-top: 10px; color: var(--pay-accent); font-size: 17px; font-weight: 600; }

.scroll-btn {
  top: 50%;
  width: 34px;
  height: 52px;
  border: 1px solid var(--pay-line);
  border-radius: var(--pay-radius);
  color: var(--pay-text);
  background: rgba(7, 20, 24, .92);
  transform: translateY(-50%);
}
.scroll-btn:hover { border-color: var(--pay-accent); background: var(--pay-accent-dark); transform: translateY(-50%); }
.scroll-btn.left { left: 0; }
.scroll-btn.right { right: 0; }
.scroll-btn i { display: none; }
.scroll-btn::before { font-size: 20px; line-height: 1; }
.scroll-btn.left::before { content: "‹"; }
.scroll-btn.right::before { content: "›"; }

.custom-price-control { margin-top: 8px; }
.custom-price-input-wrapper {
  height: 40px;
  border: 1px solid var(--pay-line);
  border-radius: var(--pay-radius);
  background: rgba(4, 14, 18, .54);
  overflow: hidden;
}
.custom-price-btn { color: var(--pay-accent); background: rgba(101, 212, 188, .05); }
.custom-price-btn:hover { background: rgba(101, 212, 188, .16); }
.custom-price-input { color: var(--pay-text); background: transparent; }
.product-card.selected .custom-price-input-wrapper { border-color: var(--pay-accent); box-shadow: none; }

.payment-section {
  display: grid;
  grid-template-columns: minmax(210px, .7fr) minmax(0, 2fr);
  column-gap: 34px;
  align-items: start;
  margin: 0;
  padding: 30px;
  border-radius: 0;
  background: rgba(5, 17, 21, .28);
  backdrop-filter: none;
}

.payment-section .step-heading {
  margin: 0;
  align-self: center;
}

.payment-title { display: none; }
.payment-methods {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}
.payment-method {
  flex: 0 0 120px;
  width: 120px;
  min-width: 120px;
  height: 60px;
  min-height: 60px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--pay-radius);
  background: rgba(19, 45, 52, .48);
  transition: border-color .2s, transform .2s, background .2s;
}
.payment-method:hover { transform: translateY(-2px); border-color: rgba(101, 212, 188, .5); background: rgba(25, 61, 65, .62); }
.payment-method:active { transform: scale(.98); }
.payment-method.selected { border-color: var(--pay-accent); box-shadow: inset 0 0 0 1px rgba(101, 212, 188, .2); }
.payment-icon {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
}
.payment-icon img {
  width: 100%;
  height: 100%;
  padding: 8px;
  object-fit: contain;
  object-position: center;
}
.payment-note {
  grid-column: 2;
  margin: 16px 0 0;
  color: var(--pay-muted);
  font-size: 12px;
  line-height: 1.55;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 34px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--pay-line);
  color: var(--pay-muted);
  font-size: 12px;
  text-align: left;
}
.footer-links { margin: 0; display: flex; flex-wrap: wrap; gap: 22px; }
.footer-link { margin: 0; color: var(--pay-muted); }
.footer-link:hover { color: var(--pay-accent); }
.copyright { margin: 0; }

@media (max-width: 900px) {
  .content { width: min(100% - 32px, 720px); padding-top: 54px; }
  .content > main { grid-template-columns: 1fr; }
  .products-section { border-right: 0; border-bottom: 1px solid var(--pay-line); }
  .search-container { grid-template-columns: 1fr; }
  .user-info.active { min-width: 0; }
  .payment-section { grid-template-columns: 1fr; row-gap: 20px; }
  .payment-section .step-heading { margin: 0; }
  .payment-methods { justify-content: flex-start; }
  .payment-note { grid-column: 1; margin-top: -4px; }
  .payment-method { min-width: 0; }
  .payment-icon img { object-position: center; }
}

@media (max-width: 580px) {
  body { background-position: 62% center; }
  .pay-topbar { height: 64px; padding: 0 18px; }
  .pay-brand { font-size: 11px; }
  .pay-brand-mark { width: 26px; height: 26px; }
  .back-home { font-size: 0; }
  .back-home::after { content: "Home"; font-size: 12px; }
  .content { width: calc(100% - 24px); min-height: calc(100dvh - 64px); padding: 44px 0 24px; }
  .store-intro { margin-bottom: 30px; }
  .store-intro h1 { font-size: 40px; }
  .store-intro > p:last-child { font-size: 14px; }
  .content > header, .products-section, .payment-section { padding: 22px 16px; }
  .step-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .search-box { align-items: stretch; flex-direction: column; }
  .search-box button { width: 100%; }
  .user-info.active { grid-template-columns: 1fr 1fr; }
  .products-container { padding: 0; }
  .products-scroll { grid-auto-columns: 82%; }
  .scroll-btn { display: none; }
  .payment-methods {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
  }
  .payment-method {
    flex-basis: 120px;
    width: 120px;
    min-width: 120px;
  }
  .footer { align-items: flex-start; flex-direction: column; }
  .footer-links { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
