:root {
  --bg: #f2f6ff;
  --card: #ffffff;
  --text: #0b1220;
  --muted: #475569;
  --primary: #1f4ed8;
  --primary-dark: #1b3ea9;
  --accent: #22c55e;
  --line: #dbe5f3;
  --shadow: 0 14px 35px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", Arial, sans-serif;
  background: radial-gradient(circle at top right, #dbeafe 0%, var(--bg) 35%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  color: #0f172a;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  z-index: 300;
}

.skip-link:focus {
  left: 10px;
  top: 10px;
}

.container {
  width: min(1140px, 92vw);
  margin: 0 auto;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid #e8eefb;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.logo {
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.2px;
  font-size: 1.05rem;
}

.nav {
  display: flex;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--primary);
}

.cart-button {
  border: 1px solid #cfdaef;
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cart-button:hover {
  background: #eff6ff;
  border-color: #bcd0ee;
}

.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  margin-left: 0.25rem;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-size: 0.8rem;
  padding: 0.1rem 0.35rem;
}

.hero {
  padding: 4.25rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.4rem;
  align-items: stretch;
}

.hero-content {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid #dce8fb;
  border-radius: 22px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.hero-content h1 {
  margin: 0.7rem 0 0.8rem;
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  line-height: 1.18;
}

.hero-content p {
  margin: 0;
  color: var(--muted);
  max-width: 66ch;
}

.badge {
  display: inline-block;
  background: #dbeafe;
  color: #1e3a8a;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.28);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #e8eefc;
  color: var(--text);
}

.btn-secondary:hover {
  background: #d8e4fb;
}

.cart-footer .btn + .btn {
  margin-top: 0.55rem;
}

.hero-card {
  background: linear-gradient(145deg, #1e3a8a, #1d4ed8);
  color: #e2e8f0;
  border: 1px solid transparent;
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.2rem 1.1rem;
}

.hero-card h3 {
  margin-top: 0;
  color: #fff;
}

.hero-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: #dbeafe;
  line-height: 1.5;
}

.hero-kpis {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.hero-kpis article {
  background: #fff;
  border: 1px solid #d7e4fa;
  border-radius: 12px;
  padding: 0.6rem;
}

.hero-kpis strong {
  display: block;
  color: var(--primary);
  font-size: 1.05rem;
}

.hero-kpis span {
  font-size: 0.82rem;
  color: var(--muted);
}

.section {
  padding: 3rem 0;
}

.section-alt {
  background: #eef2ff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
}

.section-head p {
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.catalog-toolbar {
  margin-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-filter-wrap {
  margin-top: 0.8rem;
}

.brand-filter-title {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.filters {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.filter-btn {
  border: 1px solid var(--line);
  background: #f8fbff;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.search-wrap input {
  border: 1px solid #d0def4;
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  min-width: min(360px, 85vw);
  background: #fff;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.03);
}

.product-grid {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.product-card {
  background: var(--card);
  border: 1px solid #dbe7fb;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.13);
}

.product-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-category {
  margin: 0 0 0.45rem;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.product-brand {
  margin: 0 0 0.35rem;
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 600;
}

.product-brand-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
}

.product-status {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.product-stock {
  margin: 0 0 0.45rem;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-в-наличии {
  background: #dcfce7;
  color: #166534;
}

.status-закончился {
  background: #fee2e2;
  color: #991b1b;
}

.status-ожидается {
  background: #fef9c3;
  color: #854d0e;
}

.product-title {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.3;
}

.product-desc {
  color: var(--muted);
  margin: 0.5rem 0 0.8rem;
  font-size: 0.94rem;
}

.product-option-wrap {
  display: block;
  margin-bottom: 0.8rem;
}

.product-option-label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.product-option {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  background: #fff;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.price {
  font-weight: 700;
}

.small-btn {
  background: #dbeafe;
  color: #1e3a8a;
  border: 0;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.small-btn:hover {
  background: #bfdbfe;
}

.small-btn:disabled {
  background: #e5e7eb;
  color: #64748b;
  cursor: not-allowed;
}

.benefits-grid {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.brand-grid {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.brand-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  place-items: center;
  min-height: 78px;
  padding: 0.65rem;
}

.brand-card img {
  max-width: 100%;
  max-height: 38px;
  object-fit: contain;
}

.cert-grid {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.cert-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}

.cert-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  margin-bottom: 0.7rem;
}

.cert-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cert-card h3 {
  margin: 0 0 0.4rem;
}

.cert-card p {
  margin: 0.25rem 0;
  color: var(--muted);
}

.cert-note {
  font-size: 0.86rem;
}

.cert-action {
  margin-top: 1rem;
}

.benefit-card {
  background: #fff;
  border: 1px solid #d7e5fa;
  border-radius: 12px;
  padding: 1rem;
}

.benefit-card h3 {
  margin: 0 0 0.45rem;
}

.benefit-card p {
  margin: 0;
  color: var(--muted);
}

.about-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.55fr 1fr;
}

.about-grid p {
  color: var(--muted);
}

.about-note {
  background: #fff;
  border: 1px solid #d7e5fa;
  border-radius: 12px;
  padding: 1rem;
}

.footer {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #e2e8f0;
  padding: 2.2rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.footer h3,
.footer h4 {
  margin-top: 0;
}

.footer a {
  color: #bfdbfe;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(430px, 92vw);
  background: #fff;
  z-index: 100;
  border-left: 1px solid #dbe5f3;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.cart-panel.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 1.2rem;
  cursor: pointer;
}

.cart-items {
  padding: 1rem;
  overflow: auto;
  flex: 1;
}

.cart-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
  margin-bottom: 0.65rem;
}

.cart-item h4 {
  margin: 0;
  font-size: 0.95rem;
}

.cart-item p {
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.cart-brand {
  margin: 0 0 0.25rem;
  color: #0f766e;
  font-size: 0.8rem;
  font-weight: 600;
}

.cart-item-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-controls button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  cursor: pointer;
}

.cart-footer {
  border-top: 1px solid var(--line);
  padding: 1rem;
}

.cart-total {
  margin-bottom: 0.7rem;
}

.full {
  width: 100%;
}

.small-note {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 90;
}

@media (prefers-reduced-motion: reduce) {
  .cart-panel {
    transition: none;
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    display: none;
  }

  .topbar-inner {
    min-height: 64px;
  }

  .search-wrap {
    width: 100%;
  }

  .search-wrap input {
    min-width: 100%;
    width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }

  .hero-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .container {
    width: min(1140px, 94vw);
  }

  .logo {
    font-size: 0.94rem;
  }

  .hero {
    padding-top: 2.8rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .cert-action {
    width: 100%;
  }

  .product-card {
    padding: 0.85rem;
  }

  .hero-content {
    padding: 1rem;
    border-radius: 16px;
  }

  .hero-kpis {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    width: 100vw;
    border-left: 0;
  }

  .cart-button {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 120;
    box-shadow: var(--shadow);
    background: var(--primary);
    color: #fff;
    border-color: transparent;
  }

  .cart-count {
    background: #fff;
    color: var(--primary);
  }

  .brand-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
