:root {
  --bg: #f2f2f2;
  --surface: #ffffff;
  --surface-soft: #f7f7f7;
  --surface-line: #dddddf;
  --text: #1e2d3d;
  --text-soft: #67788a;
  --primary: #1990f6;
  --primary-dark: #0b72d2;
  --primary-soft: #eaf5ff;
  --shadow: 0 6px 20px rgba(26, 41, 61, 0.06);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --container: min(1380px, calc(100vw - 72px));
  --transition: 220ms ease;
  font-family: "Segoe UI", "Manrope", "Nunito Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

body.no-scroll {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

a,
button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

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

.container {
  width: var(--container);
  margin: 0 auto;
}

.desktop-only {
  display: none !important;
}

.mobile-only {
  display: block !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(221, 221, 223, 0.9);
}

.topbar {
  border-bottom: 1px solid #ececef;
}

.topbar-inner {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--text-soft);
}

.topbar-city {
  color: var(--text);
  font-weight: 600;
  position: relative;
  padding-left: 16px;
}

.topbar-city::before,
.mobile-meta-inner > span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  transform: translateY(-50%);
}

.topbar-pill,
.topbar-icon,
.catalog-button,
.search-form,
.mobile-catalog-button,
.header-action,
.sort-select,
.products-tab,
.category-card,
.catalog-card,
.product-card,
.drawer,
.info-card,
.drawer-item {
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.topbar-pill,
.topbar-icon {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
}

.topbar-icon {
  width: 38px;
  padding: 0;
  position: relative;
}

.topbar-icon::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: block;
  margin: auto;
}

.mobile-meta {
  border-bottom: 1px solid #ececef;
  background: var(--surface);
}

.mobile-meta-inner {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.mobile-meta-inner > span {
  position: relative;
  padding-left: 14px;
  font-size: 0.95rem;
}

.mobile-meta-spacer {
  display: block;
}

.mobile-logo {
  justify-self: center;
}

.mobile-logo img {
  width: 122px;
  height: auto;
}

.mainbar {
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(236, 236, 239, 0.92);
}

.mainbar-inner {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}

.brand img {
  width: 184px;
  height: auto;
}

.catalog-button {
  min-height: 36px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--surface);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.98rem;
  font-weight: 700;
}

.catalog-button:hover,
.mobile-catalog-button:hover,
.search-form button:hover,
.product-buy:hover {
  background: var(--primary-dark);
}

.catalog-button-icon {
  width: 16px;
  display: inline-grid;
  gap: 3px;
}

.catalog-button-icon span,
.mobile-catalog-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  margin: 0 auto;
}

.mobile-search-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.mobile-catalog-button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--surface);
  display: inline-grid;
  gap: 4px;
  place-content: center;
}

.search-form {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid #d2d2d5;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
}

.search-form svg {
  width: 20px;
  height: 20px;
  fill: #8d9199;
}

.search-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 0.98rem;
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.header-action {
  min-width: 78px;
  padding: 6px 4px;
  border-radius: 10px;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.header-action:hover {
  background: var(--surface-soft);
}

.header-action-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  color: var(--text);
}

.header-action-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.header-action strong {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.catalog-menu {
  margin-bottom: 14px;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid #e5e5e7;
}

.catalog-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.catalog-menu-head strong {
  font-size: 1.1rem;
}

.catalog-menu-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 1.6rem;
  line-height: 1;
}

.catalog-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
}

.catalog-card,
.category-card {
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid #ececef;
  box-shadow: var(--shadow);
}

.catalog-card {
  padding: 10px 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  justify-items: start;
  text-align: left;
}

.catalog-card strong {
  font-size: 0.98rem;
  line-height: 1.35;
  font-weight: 500;
  color: var(--text);
}

.hero {
  padding-top: 12px;
}

.hero-shell {
  width: min(1380px, calc(100vw - 72px));
  margin: 0 auto;
}

.hero-slider {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background: #f1f1f3;
  border-radius: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(16, 35, 60, 0.42) 0%, rgba(16, 35, 60, 0.16) 32%, rgba(16, 35, 60, 0.04) 70%),
    var(--hero-image) center center / cover no-repeat;
  transition: opacity 500ms ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide-inner {
  min-height: 360px;
  display: flex;
  align-items: center;
  padding-left: 90px;
}

.hero-copy {
  max-width: 460px;
  color: var(--surface);
}

.hero-copy-promo h1 {
  margin: 0;
  font-size: clamp(2.25rem, 3.5vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.hero-brandline {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.hero-copy-promo p {
  margin: 12px 0 0;
  font-size: 1rem;
  line-height: 1.45;
}

.hero-note {
  display: inline-block;
  margin-top: 26px;
  font-size: 1rem;
  font-weight: 800;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.14);
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.48);
}

.hero-dot.is-active {
  background: var(--surface);
}

.hero-mobile {
  padding: 10px 0 0;
}

.hero-mobile-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 46%;
  gap: 10px;
  overflow-x: auto;
  padding: 0 16px 4px;
  scroll-snap-type: x mandatory;
}

.hero-mobile-card {
  min-height: 152px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(18, 34, 58, 0.02), rgba(18, 34, 58, 0.18)),
    var(--hero-image) center center / cover no-repeat;
  scroll-snap-align: start;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-mobile-card-copy {
  height: 100%;
  padding: 14px;
  display: flex;
  align-items: flex-end;
  color: var(--surface);
}

.hero-mobile-card-copy strong {
  max-width: 10ch;
  font-size: 0.95rem;
  line-height: 1.2;
}

.categories-section {
  padding: 26px 0 0;
}

.section-title-row,
.products-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section-title-row h2,
.products-head h2 {
  margin: 0;
  font-size: clamp(2rem, 2.6vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.section-title-row-narrow {
  max-width: 1280px;
  margin: 0 auto;
}

.section-title-narrow {
  width: 100%;
}

.popular-grid-wrap {
  max-width: 1280px;
  margin: 0 auto;
}

.popular-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.category-card {
  padding: 18px 12px 18px;
  min-height: 164px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
}

.category-card:hover,
.catalog-card:hover,
.product-card:hover {
  transform: translateY(-2px);
}

.category-card img {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.category-card strong {
  font-size: 1rem;
  line-height: 1.28;
  font-weight: 500;
}

.sale-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--primary);
  position: relative;
}

.sale-icon::before,
.sale-icon::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.sale-icon::before {
  width: 38px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface);
  transform: translate(-50%, -50%) rotate(-45deg);
}

.sale-icon::after {
  width: 40px;
  height: 40px;
  background:
    radial-gradient(circle at 10px 10px, var(--surface) 0 5px, transparent 6px),
    radial-gradient(circle at 30px 30px, var(--surface) 0 5px, transparent 6px);
}

.products-section {
  padding: 42px 0 110px;
}

.products-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

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

.products-tab,
.sort-select {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #d8d8da;
  background: var(--surface);
  color: var(--text);
}

.products-tab.is-active {
  background: var(--primary-soft);
  border-color: #cce5ff;
  color: var(--primary-dark);
}

.breadcrumbs {
  display: flex;
  gap: 8px;
  color: var(--text-soft);
  margin-bottom: 6px;
  font-size: 0.92rem;
}

.products-summary {
  margin-top: 16px;
  margin-bottom: 16px;
  color: var(--text-soft);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-card {
  padding: 14px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid #ececef;
  display: grid;
  gap: 12px;
}

.product-media {
  min-height: 180px;
  border-radius: 14px;
  background: #fafafa;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}

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

.product-tag {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
}

.product-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.product-price strong {
  font-size: 1.1rem;
}

.product-price s,
.product-meta {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

.product-buy,
.product-icon {
  min-height: 42px;
  border-radius: 12px;
}

.product-buy {
  background: var(--primary);
  color: var(--surface);
  font-weight: 700;
}

.product-icon {
  width: 42px;
  background: var(--surface-soft);
  color: var(--text-soft);
  border: 1px solid #e2e2e4;
  display: inline-grid;
  place-items: center;
}

.product-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.product-icon.is-active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: #cce5ff;
}

.mobile-bottom-nav {
  position: fixed;
  inset: auto 0 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 10px 6px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #e4e4e6;
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.04);
}

.mobile-bottom-nav a,
.mobile-bottom-nav button {
  min-height: 48px;
  border-radius: 12px;
  color: var(--text-soft);
  font-size: 0.78rem;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
}

.mobile-bottom-nav svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.mobile-bottom-nav .is-active {
  color: var(--primary);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 36, 52, 0.4);
}

.drawer {
  position: absolute;
  right: 0;
  top: 0;
  width: min(420px, 100%);
  height: 100%;
  padding: 20px;
  background: var(--surface);
  box-shadow: -12px 0 34px rgba(18, 28, 41, 0.16);
  display: grid;
  grid-template-rows: auto 1fr;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.drawer-head h3 {
  margin: 0;
  font-size: 1.6rem;
}

.drawer-head button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 1.6rem;
  line-height: 1;
}

.drawer-body {
  display: grid;
  gap: 12px;
  overflow: auto;
}

.empty-state,
.drawer-item,
.info-card {
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid #e8e8ea;
  box-shadow: var(--shadow);
}

.empty-state {
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.empty-state img {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.empty-state h4,
.drawer-item strong,
.info-card strong {
  margin: 0;
  font-size: 1rem;
}

.empty-state p,
.drawer-item p,
.drawer-item span,
.info-card p,
.info-card li {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.drawer-item-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.drawer-item-head img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 12px;
  background: #f8f8f8;
}

.drawer-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.drawer-btn {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
}

.drawer-btn-primary {
  background: var(--primary);
  color: var(--surface);
}

.profile-drawer ul {
  margin: 12px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

@media (min-width: 980px) {
  .topbar.desktop-only,
  .brand.desktop-only,
  .hero.desktop-only {
    display: block !important;
  }

  .catalog-button.desktop-only {
    display: inline-flex !important;
  }

  .header-actions.desktop-only {
    display: flex !important;
  }

  .mobile-only {
    display: none !important;
  }

  .mainbar-inner {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 16px;
    padding: 10px 0;
  }

  .popular-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
  }

  .products-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (min-width: 1320px) {
  .products-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 979px) {
  .mainbar-inner {
    min-height: 56px;
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 10px 0 12px;
  }

  .search-form {
    min-height: 46px;
    border-radius: 12px;
  }

  .catalog-menu-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .catalog-menu {
    padding: 14px 16px 18px;
    border-radius: 0 0 18px 18px;
    margin-bottom: 0;
  }

  .section-title-row h2,
  .products-head h2 {
    font-size: 1.15rem;
    letter-spacing: normal;
  }

  .products-head {
    flex-direction: column;
    align-items: stretch;
  }

  .products-toolbar {
    justify-content: space-between;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drawer {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(80vh, 700px);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
  }
}

@media (max-width: 719px) {
  :root {
    --container: min(100vw - 32px, 100vw - 32px);
  }

  .mobile-logo img {
    width: 118px;
  }

  .mobile-catalog-button {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .mobile-meta-inner {
    min-height: 56px;
  }

  .hero-mobile-track {
    grid-auto-columns: 44%;
    gap: 8px;
    padding: 0 16px 4px;
  }

  .hero-mobile-card {
    min-height: 150px;
  }

  .category-card {
    min-height: 136px;
    padding: 14px 8px 16px;
  }

  .category-card img,
  .sale-icon {
    width: 64px;
    height: 64px;
  }

  .category-card strong {
    font-size: 0.94rem;
  }

  .product-media {
    min-height: 150px;
  }

  .product-media img {
    max-width: none;
    max-height: none;
  }

  .products-section {
    padding-bottom: 92px;
  }

  .mobile-bottom-nav {
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
