:root {
  --bg: #05070b;
  --panel: #0d1320;
  --panel-soft: rgba(10, 14, 22, 0.72);
  --border: #1b2740;
  --text: #ffffff;
  --muted: #97a0ad;
  --muted-2: #cfd5df;
  --accent: #4f8cff;
  --accent-dark: #2f6fe8;
  --danger: #ff5c7a;
  --success: #35d07f;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: repeating-linear-gradient(
    90deg,
    #05070b 0,
    #05070b 70px,
    #08101d 71px,
    #05070b 140px
  );
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.wrapper {
  max-width: 1200px;
  margin: auto;
  padding: 24px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 60px;
}

.logo {
  text-decoration: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
}

.support-link {
  color: #ffffff;
  text-decoration: none;
  padding: 12px 18px;
  border-radius: 16px;
  background: #121723;
  border: 1px solid #2a3244;
  transition: 0.18s ease;
}

.support-link:hover {
  background: #1a2233;
}

.hero h1 {
  font-size: 56px;
  line-height: 1.05;
  margin-bottom: 18px;
}

.features {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  color: #d7dde8;
  margin-bottom: 28px;
}

.order-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(10, 14, 22, 0.7);
}

.order-status-title {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
}

.order-status-text {
  color: var(--muted-2);
  line-height: 1.45;
}

.catalog {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.catalog::-webkit-scrollbar {
  height: 10px;
}

.catalog::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.catalog::-webkit-scrollbar-thumb {
  background: #26344f;
  border-radius: 999px;
}

.country {
  flex: 0 0 520px;
  min-width: 520px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  scroll-snap-align: start;
}

.country-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.country-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 10px;
  background: #111827;
}

.country h2 {
  font-size: 22px;
}

.item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.item:hover .price {
  background: #1a2233;
}

.item:last-child {
  border-bottom: none;
}

.item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.item-logo {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 10px;
  background: #111827;
}

.item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price {
  flex: 0 0 auto;
  background: #121723;
  padding: 10px 16px;
  border-radius: 12px;
  transition: 0.18s ease;
}

.loading,
.empty,
.error-box {
  width: 100%;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(10, 14, 22, 0.7);
  color: var(--muted-2);
}

.error-box {
  color: var(--danger);
}

.footer {
  margin-top: 40px;
  padding: 20px 0 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-main {
  display: grid;
  grid-template-columns: 220px 260px 1fr;
  gap: 24px;
  align-items: start;
}

.footer-section h3 {
  margin-bottom: 8px;
  color: #9aa3b2;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.footer-section p,
.footer-section a {
  color: #cfd5df;
  font-size: 13px;
  line-height: 1.45;
  text-decoration: none;
}

.footer-section a:hover {
  color: #ffffff;
}

.footer-legal p {
  color: #a5adba;
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 470px);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #0b101b;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: #141b2a;
  font-size: 24px;
  line-height: 1;
}

.modal-product {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
  padding-right: 34px;
}

.modal-product-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 14px;
  background: #111827;
}

.modal-product h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

.modal-product p {
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1.35;
}

.purchase-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1.4;
}

.purchase-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #26344f;
  border-radius: 14px;
  outline: none;
  color: #ffffff;
  background: #090e18;
}

.purchase-form input:focus {
  border-color: var(--accent);
}

.form-error {
  margin-top: 10px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.primary-button,
.secondary-button,
.small-button {
  border: 0;
  border-radius: 14px;
  color: #ffffff;
  transition: 0.18s ease;
}

.primary-button {
  flex: 1;
  min-height: 48px;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button:disabled {
  cursor: default;
  opacity: 0.65;
}

.secondary-button {
  min-height: 48px;
  padding: 0 18px;
  background: #141b2a;
}

.secondary-button:hover,
.small-button:hover {
  background: #1a2233;
}

.small-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  background: #141b2a;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .wrapper {
    padding: 18px;
  }

  header {
    margin-bottom: 44px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .features {
    flex-direction: column;
    gap: 10px;
  }

  .order-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .country {
    flex-basis: 86vw;
    min-width: 86vw;
    padding: 20px;
  }

  .item-name {
    white-space: normal;
  }

  .footer {
    margin-top: 32px;
    padding-top: 18px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .footer-section h3 {
    margin-bottom: 5px;
  }

  .footer-section p,
  .footer-section a,
  .footer-legal p {
    font-size: 12px;
    line-height: 1.4;
  }

  .modal {
    align-items: end;
    padding: 12px;
  }

  .modal-card {
    padding: 20px;
    border-radius: 22px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .secondary-button {
    width: 100%;
  }
}