:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --link: #2997ff;
  --danger: #e30000;
  --ok: #1d9e46;
  --line: #d2d2d7;
  --radius: 18px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 22px; position: relative; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* Шапка — тёмная, как на apple.com */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(22, 22, 23, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}

.logo {
  font-size: 1rem;
  font-weight: 600;
  color: #f5f5f7;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.logo span { color: #86868b; font-weight: 400; }

.nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 38px;
}

.nav a {
  color: #f5f5f7;
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.nav a:hover { color: #2997ff; }

.cart-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 1rem;
  color: #f5f5f7;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 999px;
  transition: opacity 0.2s;
}

.cart-btn:hover { opacity: 0.7; }

.cart-count {
  position: absolute;
  top: -3px;
  right: -6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 600;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: #f5f5f7;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.burger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Hero */
.hero {
  position: relative;
  background: #000;
  color: #f5f5f7;
  text-align: center;
  padding: 72px 0 70px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 840px;
  padding: 0 22px;
}

.slide-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--link);
  margin-bottom: 16px;
}

.hero-content h1 {
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

.hero-content p {
  color: #a1a1a6;
  font-size: clamp(1.05rem, 2.5vw, 1.4rem);
  max-width: 640px;
  margin: 0 auto 30px;
}

.hero-links {
  display: flex;
  gap: 30px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.hero-video {
  display: block;
  width: min(1000px, 94vw);
  aspect-ratio: 16 / 9;
  max-height: 58vh;
  object-fit: cover;
  object-position: center;
  border-radius: 24px;
  background: #111;
  box-shadow: 0 30px 90px rgba(0, 113, 227, 0.22), 0 10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  margin-top: 46px;
}

/* Кнопки и ссылки в стиле Apple */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 980px;
  border: none;
  font-size: 1rem;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
  letter-spacing: -0.01em;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: #c7c7cc; cursor: default; }

.btn-block { width: 100%; }
.btn-sm { padding: 9px 20px; font-size: 0.92rem; }

.link-more {
  color: var(--accent);
  font-size: 1.05rem;
  text-decoration: none;
}

.hero .link-more { color: var(--link); }
.link-more:hover { text-decoration: underline; }
.link-more::after { content: " ›"; }

/* Секции */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }

h2 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-sub {
  text-align: center;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  margin-bottom: 44px;
}

/* Тулбар каталога */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 46px;
}

.search {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  padding: 11px 20px;
  border-radius: 980px;
  border: none;
  background: var(--bg-alt);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

.section-alt .search { background: #fff; }
.search::placeholder { color: var(--muted); }
.search:focus { outline: 2px solid rgba(0, 113, 227, 0.4); outline-offset: 1px; }

.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.chip {
  padding: 9px 22px;
  border-radius: 980px;
  border: none;
  background: var(--bg-alt);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  transition: 0.2s;
}

.section-alt .chip { background: #fff; }
.chip:hover { background: #e8e8ed; }
.chip.active { background: var(--text); color: #fff; }

/* Товары — крупные плитки в стиле Apple */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 52px 28px;
}

.product {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.product-media {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 20px;
  background: var(--bg-alt);
}

.product-img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

.product-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 240px;
  font-size: 4.5rem;
  line-height: 1;
}

.product:hover .product-img { transform: scale(1.04); }

.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.badge.new { background: var(--accent); color: #fff; }

.product-cat {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
}

.product h3 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.product-desc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 300px;
  flex: 1;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  justify-content: center;
}

.price { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.old-price { color: var(--muted); text-decoration: line-through; font-size: 0.95rem; font-weight: 400; }

.btn-add {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.05rem;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s;
}

.btn-add::after { content: " ›"; }
.btn-add:hover { text-decoration: underline; }
.btn-add:disabled { color: #c7c7cc; cursor: default; text-decoration: none; }

.empty { text-align: center; color: var(--muted); padding: 50px 0; font-size: 1.1rem; }

/* Промо-плитки */
.promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 22px;
}

.promo {
  background: #fff;
  border-radius: 24px;
  padding: 56px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.promo:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.08);
}

.promo-icon { font-size: 2.6rem; line-height: 1; }

.promo h3 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.promo p { color: var(--muted); font-size: 1rem; max-width: 380px; margin-bottom: 6px; }

/* Инфо-карточки */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
}

.info-card {
  background: var(--bg-alt);
  border-radius: 24px;
  padding: 46px 32px;
  text-align: center;
  transition: transform 0.3s ease;
}

.info-card:hover { transform: translateY(-4px); }

.info-icon { font-size: 2.6rem; margin-bottom: 16px; }
.info-card h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.015em; }
.info-card p { color: var(--muted); font-size: 1rem; }

/* Подвал в стиле Apple */
.footer {
  background: var(--bg-alt);
  color: var(--muted);
  padding: 40px 0 26px;
  font-size: 0.8rem;
  border-top: 1px solid var(--line);
}

.footer-cols {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 34px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.footer .logo {
  color: var(--text);
  font-size: 1rem;
  display: inline-block;
  margin-bottom: 10px;
}

.footer-about { max-width: 280px; line-height: 1.6; }

.footer h4 {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}

.footer ul { list-style: none; }

.footer li { margin-bottom: 9px; line-height: 1.5; }

.footer a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer a:hover { color: var(--text); text-decoration: underline; }
.footer .admin-link { color: var(--accent); }

.footer-legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 18px;
  font-size: 0.75rem;
}

.footer-legal-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* Корзина */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 90;
  animation: fade 0.25s ease;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: #fff;
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.18);
  animation: slide 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes slide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.cart-head h3 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }

.icon-btn {
  background: var(--bg-alt);
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  transition: background 0.2s;
}

.icon-btn:hover { background: #e8e8ed; }

.cart-items { flex: 1; overflow-y: auto; padding: 16px 22px; }

.cart-empty { color: var(--muted); text-align: center; padding: 50px 0; }

.cart-item {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--bg-alt);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}

.cart-item-icon { font-size: 1.8rem; }
.cart-item-img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info strong { display: block; font-size: 0.95rem; font-weight: 600; }
.cart-item-info span { color: var(--muted); font-size: 0.9rem; }

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

.qty button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: background 0.2s;
}

.qty button:hover { background: #e8e8ed; }
.qty span { min-width: 20px; text-align: center; font-size: 0.95rem; }

.cart-foot {
  padding: 18px 22px 24px;
  border-top: 1px solid var(--line);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.cart-total strong { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }

.cart-foot input,
.cart-foot textarea {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 14px;
  border: none;
  background: var(--bg-alt);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

.cart-foot input:focus,
.cart-foot textarea:focus { outline: 2px solid rgba(0, 113, 227, 0.4); outline-offset: 1px; }

.form-status { min-height: 1.4em; font-size: 0.92rem; text-align: center; margin-top: 10px; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }

@media (max-width: 900px) {
  .footer-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .burger { display: flex; }

  .nav {
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    transform: none;
    flex-direction: column;
    gap: 0;
    background: rgba(22, 22, 23, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
  }

  .nav.open { display: flex; }

  .nav a {
    padding: 15px 22px;
    font-size: 0.95rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .hero { padding: 50px 0 54px; }
  .hero-video { margin-top: 34px; max-height: 50vh; border-radius: 18px; }
  .hero-content p { font-size: 1.05rem; }
  .section { padding: 64px 0; }
  .promo { padding: 44px 26px; }
}

@media (max-width: 400px) {
  .hero-content h1 { font-size: clamp(2rem, 11vw, 2.8rem); }
  .hero-links { gap: 18px; }
  .footer-cols { grid-template-columns: 1fr; gap: 26px; }
  .footer-legal { justify-content: flex-start; }
}

/* Низкие экраны (ландшафт телефона, маленькие окна) */
@media (max-height: 600px) {
  .hero { padding: 40px 0 44px; }
  .hero-content h1 { font-size: clamp(1.8rem, 6vh, 3rem); margin-bottom: 10px; }
  .hero-content p { margin-bottom: 18px; }
  .hero-video { max-height: 45vh; margin-top: 28px; }
  .slide-tag { margin-bottom: 8px; }
}

@media (max-height: 420px) {
  .hero { padding: 30px 0 34px; }
  .slide-tag { display: none; }
  .hero-content p { display: none; }
  .hero-video { max-height: 55vh; }
}
