.catalog-page {
  background: #f5f7fb;
  overflow-x: hidden;
}

/* Main page spacing */
.catalog-main {
  padding: 24px 0 56px;
}

/* Hero / intro */
.catalog-hero {
  padding: 0 0 20px;
}

.catalog-hero-card {
  background: linear-gradient(135deg, #f8fbff 0%, #edf5ff 100%);
  border: 1px solid #d9e6f4;
  border-radius: 32px;
  padding: 28px 20px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.catalog-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  font-size: 15px;
  color: #64748b;
}

.catalog-breadcrumbs a {
  color: #64748b;
  text-decoration: none;
}

.catalog-breadcrumbs strong {
  color: #0f172a;
  font-weight: 800;
}

.catalog-kicker {
  margin: 0 0 10px;
  color: #5d738f;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 13px;
  font-weight: 800;
}

.catalog-hero-copy h1 {
  margin: 0 0 12px;
  color: #0f172a;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.catalog-hero-copy p:last-child {
  margin: 0;
  color: #5f6f85;
  font-size: 18px;
  line-height: 1.75;
}

/* Toolbar */
.catalog-controls-section {
  padding: 8px 0 20px;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.catalog-filter-toggle,
.catalog-sort-select,
.catalog-clear-btn {
  min-height: 56px;
  border-radius: 999px;
  border: 1px solid #cad8e8;
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
  font-size: 16px;
}

.catalog-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.catalog-filter-toggle:hover {
  border-color: #b9cde2;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.catalog-sort-wrap {
  flex: 1;
  max-width: 320px;
}

.catalog-sort-select {
  width: 100%;
  padding: 0 18px;
  cursor: pointer;
  outline: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  -webkit-appearance: none;
  appearance: none;
}

.catalog-sort-select:focus {
  border-color: #72a9df;
  box-shadow: 0 0 0 4px rgba(47, 132, 191, 0.14);
}

.catalog-results-bar {
  margin-bottom: 18px;
}

.catalog-results-bar p {
  margin: 0;
  color: #617186;
  font-size: 16px;
  font-weight: 700;
}

/* Layout */
.catalog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

/* Sidebar / filter modal base */
.catalog-sidebar {
  display: none;
}

.catalog-sidebar-card {
  background: #ffffff;
  border: 1px solid #d7e2ef;
  border-radius: 26px;
  padding: 22px 18px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.catalog-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.catalog-sidebar-header h2 {
  margin: 0;
  font-size: 26px;
  color: #0f172a;
}

.catalog-sidebar-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: #f3f6fb;
  color: #1675db;
  font-size: 30px;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease;
}

.catalog-sidebar-close:hover {
  background: #eaf2fb;
  transform: scale(1.04);
}

.catalog-filter-group + .catalog-filter-group {
  margin-top: 22px;
}

.catalog-filter-group h3 {
  margin: 0 0 14px;
  font-size: 20px;
  color: #0f172a;
}

.catalog-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: #334155;
  font-size: 16px;
}

.catalog-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #4a97d1;
}

.catalog-price-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.catalog-price-inputs input {
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid #d6dfeb;
  padding: 0 14px;
  font-size: 16px;
  background: #fff;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.catalog-price-inputs input:focus {
  border-color: #72a9df;
  box-shadow: 0 0 0 4px rgba(47, 132, 191, 0.12);
}

.catalog-filter-actions {
  margin-top: 18px;
}

.catalog-clear-btn {
  width: 100%;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.catalog-clear-btn:hover {
  border-color: #b9cde2;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

/* Product grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.catalog-product-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #d7e2ef;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
  min-width: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.catalog-product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 36px rgba(15, 23, 42, 0.1);
  border-color: #bfd0e3;
}

.catalog-product-image-wrap {
  position: relative;
  background: linear-gradient(180deg, #fbfdff 0%, #f1f6fc 100%);
  padding: 18px 14px 12px;
  min-height: 205px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.catalog-product-image-wrap img {
  width: 100%;
  max-width: 150px;
  height: auto;
  object-fit: contain;
}

.catalog-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: linear-gradient(135deg, #4fa2dc, #2b78d0);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 10px 14px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(74, 151, 209, 0.22);
}

.catalog-product-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 18px 20px;
}

.catalog-product-title {
  margin: 0 0 12px;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
  min-height: 2.4em;
}

.catalog-product-price-wrap {
  margin-bottom: 16px;
  min-height: 56px;
}

.catalog-product-old-price {
  display: block;
  margin-bottom: 4px;
  color: #a4aebb;
  font-size: 15px;
  font-weight: 700;
  text-decoration: line-through;
}

.catalog-product-price {
  display: block;
  color: #244aa5;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

.catalog-product-button {
  margin-top: auto;
  width: 100%;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #007bff, #0066cc);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(0, 123, 255, 0.25);
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.catalog-product-button:hover {
  transform: translateY(-1px);
  opacity: 0.97;
  box-shadow: 0 16px 32px rgba(0, 123, 255, 0.35);
}

.catalog-empty,
.catalog-empty-state {
  grid-column: 1 / -1;
  background: #ffffff;
  border: 1px solid #d7dfeb;
  border-radius: 24px;
  padding: 34px 22px;
  text-align: center;
  color: #64748b;
  font-size: 17px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Desktop */
@media (min-width: 900px) {
  .catalog-layout {
    grid-template-columns: 290px minmax(0, 1fr);
    align-items: start;
  }

  .catalog-sidebar {
    display: block !important;
    position: static;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    background: transparent;
  }

  .catalog-sidebar::before {
    display: none;
  }

  .catalog-sidebar-card {
    position: static;
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    transform: none;
  }

  .catalog-sidebar-close,
  .catalog-filter-toggle {
    display: none;
  }

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

  .catalog-product-image-wrap {
    min-height: 235px;
  }

  .catalog-product-image-wrap img {
    max-width: 180px;
  }
}

/* Mobile / tablet popup modal */
@media (max-width: 899px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .catalog-sidebar {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
  }

  .catalog-sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.46);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.18s ease;
  }

  .catalog-sidebar-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(92vw, 420px);
    max-height: min(82vh, 720px);
    overflow-y: auto;
    border-radius: 28px;
    padding: 22px 18px 20px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
    transform: translate(-50%, -50%) scale(0.96);
    transition: transform 0.18s ease, opacity 0.18s ease;
    opacity: 0;
  }

  .catalog-sidebar.catalog-sidebar-open,
  .catalog-sidebar.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .catalog-sidebar.catalog-sidebar-open::before,
  .catalog-sidebar.active::before {
    opacity: 1;
  }

  .catalog-sidebar.catalog-sidebar-open .catalog-sidebar-card,
  .catalog-sidebar.active .catalog-sidebar-card {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .catalog-main {
    padding: 18px 0 42px;
  }

  .catalog-hero {
    padding: 0 0 16px;
  }

  .catalog-hero-card {
    border-radius: 26px;
    padding: 22px 18px;
  }

  .catalog-hero-copy h1 {
    font-size: 30px;
  }

  .catalog-hero-copy p:last-child {
    font-size: 16px;
    line-height: 1.65;
  }

  .catalog-toolbar {
    gap: 10px;
    margin-bottom: 18px;
  }

  .catalog-filter-toggle,
  .catalog-sort-select {
    min-height: 48px;
    font-size: 14px;
    padding: 0 16px;
  }

  .catalog-sort-wrap {
    max-width: none;
    width: 100%;
  }

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

  .catalog-product-card {
    border-radius: 22px;
  }

  .catalog-product-image-wrap {
    min-height: 150px;
    padding: 16px 10px 8px;
  }

  .catalog-product-image-wrap img {
    max-width: 120px;
  }

  .catalog-badge {
    top: 10px;
    left: 10px;
    min-height: 30px;
    padding: 5px 10px;
    font-size: 11px;
  }

  .catalog-product-body {
    padding: 14px 14px 16px;
  }

  .catalog-product-title {
    font-size: 16px;
    min-height: 2.4em;
    margin-bottom: 8px;
  }

  .catalog-product-old-price {
    font-size: 13px;
  }

  .catalog-product-price {
    font-size: 16px;
  }

  .catalog-product-button {
    min-height: 48px;
    font-size: 15px;
  }

  .catalog-sidebar-card {
    width: min(94vw, 380px);
    border-radius: 24px;
    padding: 18px 16px;
  }
}

.catalog-sort-wrap {
  position: relative;
}

.catalog-sort-wrap::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #0f172a;
  font-size: 16px;
  line-height: 1;
}

.catalog-sort-select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 48px;
  background-image: none !important;
}
