/* =========================================================================
   5 Элемент — дизайн-система в стилистике Apple, адаптирована под
   интернет-магазин компьютерной техники.
   ========================================================================= */

:root {
  --bg: #ffffff;
  --bg-dim: #f5f5f7;
  --bg-dark: #000000;
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --text-on-dark: #f5f5f7;
  --text-on-dark-dim: #a1a1a6;
  --accent-solid: #2f8f5b;
  --accent: rgba(47, 143, 91, 0.3);
  --accent-hover: rgba(47, 143, 91, 0.42);
  --accent-soft: rgba(47, 143, 91, 0.14);
  --success: #2ea043;
  --danger: #ff3b30;
  --line: #d2d2d7;
  --line-dark: #29292c;

  --radius-s: 12px;
  --radius-m: 18px;
  --radius-l: 28px;
  --radius-pill: 10px;

  --shadow-card: 0 2px 24px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 20px 48px rgba(0, 0, 0, 0.12);

  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Helvetica Neue", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.section-pad { padding: 88px 0; }
@media (max-width: 734px) { .section-pad { padding: 56px 0; } }

.eyebrow { display: inline-block; font-size: 15px; font-weight: 600; letter-spacing: 0.02em; color: var(--accent-solid); margin-bottom: 12px; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.display-1 { font-size: clamp(2.4rem, 5.4vw, 4.6rem); line-height: 1.06; letter-spacing: -0.03em; }
.display-2 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.1; letter-spacing: -0.02em; }
.lede { font-size: clamp(1.05rem, 1.5vw, 1.25rem); line-height: 1.5; color: var(--text-dim); font-weight: 400; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-head p { margin-top: 14px; }

/* ---------------------------------------------------------------------
   Кнопки
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 8px; font-size: 16px; font-weight: 500;
  border: 1px solid transparent; transition: transform 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-solid); border-color: var(--accent-solid); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: var(--line); color: var(--text-dim); border-color: transparent; cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--accent-solid); border-color: var(--line); }
.btn-secondary:hover { background: var(--bg-dim); }
.btn-light { background: #fff; color: var(--text); }
.btn-light:hover { box-shadow: var(--shadow-card-hover); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ---------------------------------------------------------------------
   Навигация
   --------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.nav-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; max-width: 1180px; margin: 0 auto;
}
.nav-logo { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.nav-logo img { height: 30px; width: auto; display: block; }
.footer-logo img { height: 26px; width: auto; display: block; margin-bottom: 12px; }
.nav-search { flex: 1; max-width: 420px; }
.nav-search input {
  width: 100%; padding: 10px 16px; border-radius: var(--radius-pill); border: 1px solid var(--line);
  font-size: 14px; background: var(--bg-dim);
}
.nav-actions { display: flex; align-items: center; gap: 14px; }
.cart-link { position: relative; display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 14px; }
.cart-badge {
  background: var(--accent); color: var(--accent-solid); font-size: 11px; font-weight: 700; border-radius: 999px;
  padding: 1px 7px; min-width: 18px; text-align: center;
}
.nav-categories { display: flex; gap: 4px; overflow-x: auto; padding: 0 24px 12px; max-width: 1180px; margin: 0 auto; }
.nav-categories a {
  padding: 7px 14px; border-radius: var(--radius-pill); font-size: 13.5px; color: var(--text-dim);
  white-space: nowrap; transition: background 0.2s, color 0.2s;
}
.nav-categories a:hover, .nav-categories a.active { background: var(--bg-dim); color: var(--text); }

.nav-dropdown { position: relative; flex-shrink: 0; }
.nav-dropdown-toggle {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-family: var(--font); color: var(--text-dim); background: none; border: none; cursor: pointer;
  white-space: nowrap; transition: background 0.2s, color 0.2s;
}
.nav-dropdown-toggle svg { transition: transform 0.2s var(--ease); }
.nav-dropdown-toggle:hover, .nav-dropdown-toggle.active { background: var(--bg-dim); color: var(--text); }
.nav-dropdown.is-open .nav-dropdown-toggle svg { transform: rotate(180deg); }

.nav-dropdown-menu {
  display: none; position: fixed; z-index: 200; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-m); box-shadow: var(--shadow-card-hover); padding: 24px; width: min(760px, calc(100vw - 32px));
}
.nav-dropdown.is-open .nav-dropdown-menu { display: block; }
.nav-dropdown-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 24px; }
@media (max-width: 640px) { .nav-dropdown-grid { grid-template-columns: repeat(2, 1fr); } }
.nav-dropdown-col h6 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-solid); margin: 0 0 10px; }
.nav-dropdown-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.nav-dropdown-col a { font-size: 13.5px; color: var(--text); display: block; padding: 2px 0; white-space: normal; border-radius: 0; background: none; }
.nav-dropdown-col a:hover, .nav-dropdown-col a.active { color: var(--accent-solid); background: none; }
.nav-dropdown-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.nav-dropdown-foot a { font-size: 13.5px; font-weight: 600; color: var(--accent-solid); }

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero {
  padding: 72px 24px 64px; text-align: center; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #fbfbfd 0%, #ffffff 60%);
}
.hero-glow { position: absolute; z-index: 0; border-radius: 50%; filter: blur(90px); opacity: 0.45; pointer-events: none; }
.hero-glow--1 { width: 480px; height: 480px; top: -180px; left: -140px; background: radial-gradient(circle, #4caf7d, transparent 70%); }
.hero-glow--2 { width: 520px; height: 520px; bottom: -220px; right: -160px; background: radial-gradient(circle, #2f8f5b, transparent 70%); }
.hero-content { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.hero-content .lede { max-width: 560px; margin: 16px auto 32px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   Категории — плитка
   --------------------------------------------------------------------- */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cat-grid { grid-template-columns: 1fr; } }
.cat-card {
  background: var(--bg-dim); border-radius: var(--radius-l); padding: 32px 28px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card-hover); }
.cat-icon {
  width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px; background: var(--accent); color: var(--accent-solid);
}
.cat-card h3 { font-size: 18px; margin-bottom: 6px; }
.cat-card p { color: var(--text-dim); font-size: 14px; margin: 0; }

/* ---------------------------------------------------------------------
   Товары
   --------------------------------------------------------------------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1000px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
  border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px;
  display: flex; flex-direction: column; background: #fff;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.product-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-3px); }
.product-thumb {
  aspect-ratio: 1 / 1; border-radius: var(--radius-s); background: linear-gradient(155deg, #f0f0f3, #e4e4ea);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px; color: var(--text-dim);
}
.product-thumb svg { width: 40%; height: 40%; opacity: 0.5; }
.product-card h4 { font-size: 14.5px; font-weight: 600; line-height: 1.35; margin-bottom: 6px; min-height: 38px; }
.product-manufacturer { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.product-stock { font-size: 12px; margin-bottom: 10px; }
.product-stock.in { color: var(--success); }
.product-stock.out { color: var(--danger); }
.product-footer { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.product-price { font-size: 18px; font-weight: 700; }

/* ---------------------------------------------------------------------
   Услуга сборки ПК
   --------------------------------------------------------------------- */
.pcbuild-section { background: radial-gradient(circle at 20% 20%, #14141a, var(--bg-dark) 55%); color: var(--text-on-dark); }
.pcbuild-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .pcbuild-grid { grid-template-columns: 1fr; gap: 36px; } }
.pcbuild-section h2 { color: #fff; margin-bottom: 16px; }
.pcbuild-section .lede { color: var(--text-on-dark-dim); margin-bottom: 28px; }
.pcbuild-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.pcbuild-list li { display: flex; gap: 10px; color: var(--text-on-dark-dim); font-size: 14.5px; align-items: flex-start; }
.pcbuild-list svg { flex-shrink: 0; margin-top: 3px; color: var(--accent-solid); }
.pcbuild-form {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-l); padding: 28px;
}

/* ---------------------------------------------------------------------
   Антивирусы
   --------------------------------------------------------------------- */
.av-card {
  display: flex; align-items: center; gap: 28px; background: var(--bg-dim);
  border-radius: var(--radius-l); padding: 36px; max-width: 720px; margin: 0 auto;
}
@media (max-width: 600px) { .av-card { flex-direction: column; text-align: center; } }
.av-logo {
  width: 84px; height: 84px; border-radius: 20px; background: linear-gradient(135deg, #00a651, #007a3d);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 28px; flex-shrink: 0;
}
.av-card h3 { font-size: 22px; margin-bottom: 6px; }
.av-card p { color: var(--text-dim); font-size: 14.5px; margin-bottom: 16px; }

/* ---------------------------------------------------------------------
   Корзина / чекаут
   --------------------------------------------------------------------- */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table td { padding: 16px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-row-name { font-weight: 500; font-size: 14.5px; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-pill); overflow: hidden; }
.qty-stepper button { width: 30px; height: 30px; background: none; border: none; font-size: 16px; }
.qty-stepper button:hover { background: var(--bg-dim); }
.qty-stepper input { width: 40px; text-align: center; border: none; font-size: 14px; }
.cart-summary { background: var(--bg-dim); border-radius: var(--radius-l); padding: 28px; }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 10px; }
.cart-summary-total { font-size: 20px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }

.form-field {
  padding: 13px 16px; border-radius: var(--radius-s); border: 1px solid var(--line); font-size: 15px;
  font-family: inherit; background: #fff; width: 100%; transition: border-color 0.2s;
}
.form-field:focus { outline: none; border-color: var(--accent-solid); }
textarea.form-field { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form-status { font-size: 14px; min-height: 20px; }
.form-status.ok { color: var(--success); }
.form-status.err { color: var(--danger); }

/* ---------------------------------------------------------------------
   Футер
   --------------------------------------------------------------------- */
footer { background: var(--bg-dark); color: var(--text-on-dark-dim); padding: 48px 0 28px; font-size: 13px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line-dark); margin-bottom: 20px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
.footer-col h5 { color: var(--text-on-dark); font-size: 13px; margin-bottom: 14px; font-weight: 600; }
.footer-col ul { display: flex; flex-direction: column; gap: 9px; }
.footer-col a { opacity: 0.8; }
.footer-col a:hover { opacity: 1; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------------------------------------------------------------------
   Reveal-анимации (progressive enhancement — см. пояснение в шаблонах)
   --------------------------------------------------------------------- */
.has-js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.has-js .reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Утилиты */
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.text-center { text-align: center; } .hidden { display: none !important; }
.badge-info { display:inline-block; background: var(--accent-soft); color: var(--accent-solid); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-pill); }
.empty-state { text-align: center; padding: 64px 24px; color: var(--text-dim); }

/* Панель менеджера — простые таблицы */
.mgr-table { width: 100%; border-collapse: collapse; margin-bottom: 40px; }
.mgr-table th, .mgr-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mgr-table th { border-bottom: 2px solid var(--line); }
.status-select { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; }
.status-new { color: var(--accent-solid); font-weight: 600; }
.status-processing { color: #ff9500; font-weight: 600; }
.status-done { color: var(--success); font-weight: 600; }
.status-canceled { color: var(--danger); font-weight: 600; }
