.products-page {
  --catalog-border: rgba(24, 70, 144, 0.1);
  --catalog-shadow: 0 24px 56px rgba(15, 43, 89, 0.1);
  --catalog-soft-shadow: 0 12px 28px rgba(15, 43, 89, 0.08);
  --catalog-blue: #1e63e9;
  --catalog-blue-dark: #123f94;
  --catalog-text: #173861;
  --catalog-muted: #6f84a4;
  --catalog-surface: #ffffff;
  --catalog-surface-soft: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
}

.products-page .page-shell {
  padding-top: 14px;
}

.products-page .header-main {
  padding: 6px 0;
}

.products-page .header-nav {
  padding-top: 6px;
}

.products-page .search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 4px;
  background: rgba(245, 248, 255, 0.95);
  border: 1px solid rgba(24, 70, 144, 0.08);
  border-radius: 999px;
  box-shadow: 0 12px 24px rgba(15, 43, 89, 0.06);
}

.products-page .search-bar input {
  height: 42px;
  padding-right: 12px;
}

.products-page .search-bar .primary-button {
  min-width: 96px;
  min-height: 38px;
  padding: 0 18px;
  flex-shrink: 0;
}

.catalog-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
  padding: 24px 28px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(85, 149, 255, 0.28), transparent 30%),
    linear-gradient(135deg, #103d90 0%, #2a72f2 100%);
  box-shadow: var(--catalog-shadow);
  color: #ffffff;
}

.catalog-hero-copy {
  display: grid;
  gap: 10px;
}

.catalog-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.catalog-topbar .section-title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.02;
}

.catalog-topbar .section-subtitle {
  margin: 0;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
}

.catalog-hero-meta {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}

.catalog-meta-card {
  display: grid;
  gap: 8px;
  width: 100%;
  align-content: center;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
}

.catalog-meta-card strong {
  font-size: 1.1rem;
  color: #ffffff;
}

.catalog-meta-card span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

.catalog-shell {
  display: block;
}

.filters-panel {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--catalog-border);
  border-radius: 24px;
  background: var(--catalog-surface);
  box-shadow: var(--catalog-soft-shadow);
}

.filters-form,
.filter-group {
  display: grid;
  gap: 12px;
}

.filter-group {
  grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 0.78fr)) auto auto auto;
  align-items: end;
}

.filters-panel .field {
  gap: 7px;
}

.filters-panel .field span {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--catalog-muted);
}

.filters-panel .field input,
.filters-panel .field select {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(24, 70, 144, 0.12);
  background: #f7faff;
  font-size: 0.92rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.filters-panel .field input:focus,
.filters-panel .field select:focus {
  border-color: rgba(30, 99, 233, 0.46);
  box-shadow: 0 0 0 4px rgba(30, 99, 233, 0.1);
  background: #ffffff;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  gap: 8px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(24, 70, 144, 0.1);
  background: #f8fbff;
  color: var(--catalog-text);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.filter-chip input {
  accent-color: var(--catalog-blue);
}

.filter-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 99, 233, 0.24);
  box-shadow: 0 10px 20px rgba(20, 60, 120, 0.08);
}

.apply-filters-button {
  min-height: 46px;
  padding: 0 20px;
  border-radius: 14px;
  box-shadow: 0 14px 24px rgba(30, 99, 233, 0.22);
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 14px;
  margin-bottom: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.catalog-toolbar-copy {
  display: grid;
  gap: 4px;
}

.catalog-toolbar strong {
  font-size: 1rem;
  color: var(--catalog-text);
}

.catalog-toolbar .section-subtitle {
  margin: 0;
  color: var(--catalog-muted);
  font-size: 0.88rem;
}

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

.filters-toggle {
  display: none;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
}

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

.product-grid .product-card {
  position: relative;
  display: grid;
  align-content: start;
  min-height: 100%;
  border-radius: 22px;
  border: 1px solid rgba(24, 70, 144, 0.08);
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(15, 43, 89, 0.08);
  overflow: hidden;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.product-grid .product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 48px rgba(15, 43, 89, 0.14);
  border-color: rgba(30, 99, 233, 0.16);
}

.product-grid .product-favorite {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(24, 70, 144, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #5e7393;
  box-shadow: 0 10px 24px rgba(15, 43, 89, 0.1);
}

.product-grid .product-favorite.is-active {
  color: #f25b7b;
}

.product-grid .product-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  padding: 20px;
  background:
    radial-gradient(circle at top left, rgba(30, 99, 233, 0.08), transparent 34%),
    linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
}

.product-grid .product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

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

.pill.offer {
  color: #0f4fb7;
  background: #e8f0ff;
  border-color: #cbdcff;
}

.pill.featured {
  color: #14653c;
  background: #e6f9ef;
  border-color: #bfe8cf;
}

.pill.brand {
  color: #6a7e9d;
  background: #f4f7fb;
  border-color: #e4ebf5;
}

.product-title {
  margin: 0;
  color: var(--catalog-text);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.34;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-store-line {
  display: grid;
  gap: 6px;
}

.product-store-line .meta-text {
  color: #6f84a4;
  font-size: 0.78rem;
  font-weight: 700;
}

.product-card-proof {
  color: #6d82a1;
  font-size: 0.78rem;
  font-weight: 700;
}

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

.offer-old-price {
  color: #8a9ab1;
  font-size: 0.8rem;
  text-decoration: line-through;
}

.product-pricing .price {
  font-size: 1.48rem;
  font-weight: 800;
  line-height: 1;
  color: var(--catalog-blue-dark);
}

.offer-discount {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  width: fit-content;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8f8ec;
  color: #10643a;
  font-size: 0.72rem;
  font-weight: 800;
}

.product-card-footer {
  display: grid;
  gap: 10px;
}

.product-delivery {
  color: var(--catalog-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.product-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
}

.offers-empty,
.catalog-error,
.catalog-skeleton {
  grid-column: 1 / -1;
}

.offers-empty,
.catalog-error {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 28px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid #e6edf6;
  box-shadow: 0 14px 30px rgba(16, 44, 85, 0.08);
}

.offers-empty strong,
.catalog-error strong {
  font-size: 1rem;
  color: var(--catalog-text);
}

.offers-empty .meta-text,
.catalog-error .meta-text {
  font-size: 0.92rem;
  color: var(--catalog-muted);
}

.catalog-error {
  background: linear-gradient(180deg, #fffefe 0%, #fff6f6 100%);
  border-color: rgba(202, 80, 80, 0.12);
}

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

.skeleton-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(24, 70, 144, 0.08);
  box-shadow: 0 12px 24px rgba(15, 43, 89, 0.06);
}

.skeleton-thumb,
.skeleton-line,
.skeleton-pill,
.skeleton-button {
  background: linear-gradient(90deg, #eef3fb 0%, #f8fbff 45%, #eef3fb 100%);
  background-size: 200% 100%;
  animation: catalogSkeleton 1.3s ease-in-out infinite;
}

.skeleton-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 18px;
}

.skeleton-pill {
  width: 84px;
  height: 24px;
  border-radius: 999px;
}

.skeleton-line {
  height: 12px;
  border-radius: 999px;
}

.skeleton-line.is-title {
  height: 16px;
  width: 88%;
}

.skeleton-line.is-short {
  width: 54%;
}

.skeleton-line.is-price {
  height: 22px;
  width: 46%;
}

.skeleton-button {
  width: 112px;
  height: 40px;
  border-radius: 12px;
}

@keyframes catalogSkeleton {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 1180px) {
  .filter-group {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .apply-filters-button {
    grid-column: span 2;
  }

  .product-grid,
  .catalog-skeleton {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .catalog-topbar {
    grid-template-columns: 1fr;
  }

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

  .apply-filters-button {
    grid-column: auto;
  }
}

@media (max-width: 860px) {
  .catalog-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 12px;
  }

  .toolbar-meta {
    width: 100%;
    justify-content: flex-end;
  }

  .filters-toggle {
    display: inline-flex;
  }

  .filters-panel {
    display: none;
  }

  .filters-panel.is-open {
    display: block;
  }

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

@media (max-width: 640px) {
  .products-page .page-shell {
    padding-top: 8px;
  }

  .products-page .search-bar {
    grid-template-columns: 1fr;
    border-radius: 22px;
    padding: 6px;
  }

  .products-page .search-bar::before {
    top: 27px;
  }

  .products-page .search-bar input {
    height: 40px;
    padding-left: 40px;
  }

  .products-page .search-bar .primary-button {
    width: 100%;
    min-height: 40px;
  }

  .catalog-topbar {
    gap: 14px;
    margin-bottom: 14px;
    padding: 18px 16px;
    border-radius: 22px;
  }

  .catalog-topbar .section-title {
    font-size: 1.8rem;
  }

  .catalog-topbar .section-subtitle {
    font-size: 0.9rem;
  }

  .catalog-meta-card {
    padding: 14px 16px;
    border-radius: 18px;
  }

  .filters-panel {
    padding: 12px;
    border-radius: 18px;
  }

  .filter-group {
    grid-template-columns: 1fr;
  }

  .product-grid,
  .catalog-skeleton {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-grid .product-card,
  .skeleton-card {
    border-radius: 18px;
  }

  .product-grid .product-favorite {
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
  }

  .product-grid .product-thumb {
    padding: 14px;
  }

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

  .product-title {
    font-size: 0.88rem;
  }

  .product-store-line .meta-text,
  .product-card-proof,
  .product-delivery {
    font-size: 0.74rem;
  }

  .product-pricing .price {
    font-size: 1.24rem;
  }

  .offer-discount {
    font-size: 0.66rem;
  }

  .product-card-action {
    width: 100%;
    min-height: 38px;
  }
}

@media (max-width: 420px) {
  .catalog-topbar {
    padding: 16px 14px;
  }

  .product-grid,
  .catalog-skeleton {
    gap: 10px;
  }

  .product-grid .product-body {
    padding: 12px;
  }
}
