:root {
  --bg: #e8ecf3;
  --surface: rgba(255, 255, 255, 0.66);
  --surface-solid: #f8fafc;
  --text: #111317;
  --muted: #5f6672;
  --line: rgba(26, 33, 46, 0.14);
  --accent: #0a84ff;
  --accent-dark: #0064d2;
  --success: #0f9d58;
  --danger: #b3261e;
  --shadow-soft: 0 24px 56px rgba(16, 24, 40, 0.14);
  --shadow-card: 0 16px 28px rgba(18, 26, 39, 0.1);
  --radius: 26px;
  --radius-sm: 12px;
  --header-height: 62px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  padding-top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 10px);
  overflow-x: hidden;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Sora", "Manrope", sans-serif;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

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

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(38% 30% at 8% 5%, rgba(10, 132, 255, 0.3), transparent 75%),
    radial-gradient(32% 30% at 92% -2%, rgba(122, 92, 255, 0.16), transparent 73%),
    radial-gradient(46% 36% at 50% 100%, rgba(151, 169, 198, 0.3), transparent 72%),
    linear-gradient(180deg, #f2f6fc 0%, #e7ebf3 54%, #e5e9f0 100%);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  backdrop-filter: blur(24px);
  background: linear-gradient(180deg, rgba(246, 248, 252, 0.84), rgba(246, 248, 252, 0.72));
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 30px rgba(30, 42, 60, 0.08);
}

.header-inner {
  max-width: 1240px;
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(140deg, #73b8ff, #0a84ff);
  box-shadow: 0 0 0 6px rgba(10, 132, 255, 0.16);
}

.main-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.main-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.65);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  min-height: 40px;
  padding: 0 14px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.cart-btn {
  border: 0;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cart-btn span {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  font-size: 0.82rem;
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 18px 80px;
  display: grid;
  gap: 18px;
}

section[id] {
  scroll-margin-top: calc(var(--header-height) + 20px);
}

.hero,
.catalog,
.service,
.contacts {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius);
}

.hero {
  padding: clamp(24px, 4vw, 44px);
  display: grid;
  gap: 16px;
  background:
    radial-gradient(120% 110% at 100% 0%, rgba(10, 132, 255, 0.14), transparent 74%),
    radial-gradient(90% 120% at 0% 100%, rgba(111, 76, 255, 0.08), transparent 70%),
    rgba(255, 255, 255, 0.7);
}

.hero-label {
  width: fit-content;
  border: 1px solid rgba(10, 132, 255, 0.24);
  background: rgba(255, 255, 255, 0.75);
  color: #0a5aaa;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(1.9rem, 4.8vw, 3.2rem);
  line-height: 1.06;
}

.hero-text {
  max-width: 740px;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.12rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.btn {
  border: 0;
  border-radius: 999px;
  min-height: 46px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(13, 23, 38, 0.2);
}

.btn-primary {
  background: linear-gradient(140deg, var(--accent), var(--accent-dark));
  color: #fff;
}

.btn-ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.catalog {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.section-head {
  display: grid;
  gap: 6px;
}

.section-head h2 {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
}

.section-head p {
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: #2f2f33;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}

.filter-btn.active {
  border-color: rgba(10, 132, 255, 0.35);
  background: rgba(10, 132, 255, 0.12);
  color: #0d5eae;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.product-card {
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 251, 255, 0.75));
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-rows: auto 1fr;
}

.product-media {
  padding: 12px 12px 8px;
  background: linear-gradient(165deg, rgba(250, 253, 255, 0.95) 0%, rgba(240, 246, 255, 0.9) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.85);
  display: grid;
  gap: 8px;
}

.product-carousel {
  display: flex;
  overflow-x: auto;
  height: clamp(300px, 40vw, 430px);
  border-radius: 18px;
  border: 1px solid rgba(186, 200, 221, 0.58);
  background:
    radial-gradient(120% 90% at 50% 0%, #ffffff 0%, #f2f5fa 75%, #eef2f7 100%);
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: auto;
  scrollbar-width: none;
}

.product-carousel::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 100%;
  min-width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  padding: 12px;
}

.product-main-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center center;
  user-select: none;
  -webkit-user-drag: none;
}

.product-card[data-type="airpods"] .product-carousel {
  background: #eceef2;
  height: clamp(280px, 34vw, 390px);
}

.product-card[data-type="airpods"] .carousel-slide {
  height: 100%;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-bottom: 2px;
}

.carousel-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  background: #b8c0cb;
  padding: 0;
  cursor: pointer;
}

.carousel-dot.active {
  background: #0a84ff;
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.2);
}

.product-body {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.product-head {
  display: grid;
  gap: 4px;
}

.product-head h3 {
  font-size: 1.04rem;
}

.product-subtitle {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.price-stock {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.price-badge,
.stock-badge {
  border-radius: 999px;
  min-height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 800;
  border: 1px solid;
}

.price-badge {
  border-color: rgba(10, 132, 255, 0.3);
  background: rgba(10, 132, 255, 0.12);
  color: #0c5cab;
}

.stock-badge {
  border-color: rgba(24, 164, 92, 0.28);
  background: rgba(20, 174, 94, 0.12);
  color: var(--success);
}

.specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spec {
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 26px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  background: rgba(248, 251, 255, 0.8);
  color: #4f5763;
  font-size: 0.72rem;
  font-weight: 700;
}

.option-group {
  display: grid;
  gap: 6px;
}

.option-title {
  font-size: 0.77rem;
  font-weight: 700;
  color: #505057;
}

.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  padding: 0;
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.color-btn.active {
  border-color: rgba(10, 132, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.16);
}

.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.22);
}

.option-select {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0 10px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  color: #35353b;
  background: rgba(255, 255, 255, 0.86);
}

.add-btn {
  width: 100%;
}

.service {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.service-card {
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.service-card h3 {
  font-size: 0.96rem;
}

.service-card p {
  color: var(--muted);
  font-size: 0.87rem;
}

.contacts {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.contacts h2 {
  font-size: 1.35rem;
}

.contacts p {
  color: var(--muted);
}

.contacts a {
  color: #0a65bf;
  font-weight: 700;
}

.contacts strong {
  color: var(--text);
}

.cart-drawer {
  position: fixed;
  right: 0;
  top: 0;
  width: min(450px, 100vw);
  height: 100vh;
  z-index: 80;
  background: #f3f6fb;
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.16);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  transform: translateX(100%);
  transition: transform 0.28s ease;
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-header {
  min-height: var(--header-height);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.cart-header h2 {
  font-size: 1rem;
}

.icon-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 36px;
  min-height: 36px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.cart-items {
  padding: 12px;
  overflow: auto;
  display: grid;
  gap: 8px;
  align-content: start;
}

.cart-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 800;
}

.cart-item-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.cart-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn,
.remove-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.remove-btn {
  margin-left: auto;
  color: var(--danger);
}

.cart-total-wrap {
  padding: 10px 12px;
}

.cart-total-wrap p {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  min-height: 42px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  font-size: 0.9rem;
  font-weight: 800;
}

.checkout-form {
  margin: 0 12px 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  display: grid;
  gap: 10px;
}

.checkout-form h3 {
  font-size: 0.96rem;
}

.checkout-form label {
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #4f4f56;
}

.checkout-form input,
.checkout-form textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 9px 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
}

.checkout-form textarea {
  min-height: 86px;
  resize: vertical;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 14, 23, 0.45);
  z-index: 60;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 90;
  transform: translate(-50%, 120%);
  padding: 10px 14px;
  border-radius: 12px;
  background: #111;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  max-width: min(92vw, 720px);
  text-align: center;
  transition: transform 0.24s ease;
}

.toast.show {
  transform: translate(-50%, 0);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: reveal 0.6s ease forwards;
}

.catalog.reveal {
  animation-delay: 0.06s;
}

.service.reveal {
  animation-delay: 0.12s;
}

.contacts.reveal {
  animation-delay: 0.18s;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .main-nav {
    justify-self: flex-start;
  }
}

@media (max-width: 860px) {
  :root {
    --header-height: 62px;
  }

  .header-inner {
    grid-template-columns: auto auto auto;
    gap: 10px;
    padding: 0 12px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.14);
    padding: 8px;
    gap: 6px;
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e8e8eb;
    border-radius: 10px;
    background: #fff;
  }

  .cart-btn {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  main {
    padding: 14px 10px 80px;
  }

  .catalog,
  .hero,
  .service,
  .contacts {
    border-radius: 16px;
  }

  .product-carousel {
    height: clamp(320px, 76vw, 520px);
  }

  .product-card[data-type="airpods"] .product-carousel {
    height: clamp(280px, 68vw, 400px);
  }
}

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

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  .hero-actions a {
    width: 100%;
  }

  .service {
    gap: 8px;
    padding: 12px;
  }

  .product-carousel {
    height: clamp(300px, 86vw, 460px);
  }

  .product-card[data-type="airpods"] .product-carousel {
    height: clamp(260px, 74vw, 360px);
  }

  .carousel-slide {
    padding: 8px;
  }

  .toast {
    font-size: 0.8rem;
  }
}
