.catalog-page { padding-bottom: 0; }

.purchase-benefits-wrapper {
  position: sticky;
  bottom: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.03);
  z-index: 900;
}

.purchase-benefits-wrapper .container {
  max-width: 1800px;
  padding: 0 40px;
}

.breadcrumbs { padding: 30px 0; font-size: 13px; color: var(--text-sec); }
.breadcrumbs a { color: var(--text); font-weight: 600; transition: 0.2s; }
.breadcrumbs a:hover { color: #000; }
.breadcrumbs span { margin: 0 8px; opacity: 0.4; }

.catalog-header-text { margin-bottom: 15px; }
.catalog-title { font-size: 32px; font-weight: 800; text-transform: uppercase; margin-bottom: 12px; letter-spacing: 0.5px; }
.catalog-layout { display: flex; gap: 40px; align-items: flex-start; margin-bottom: 60px; }

.catalog-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 15px;
}

.catalog-sidebar::-webkit-scrollbar { width: 6px; }
.catalog-sidebar::-webkit-scrollbar-track { background: transparent; }
.catalog-sidebar::-webkit-scrollbar-thumb { background: #e5e5ea; border-radius: 10px; }
.catalog-sidebar::-webkit-scrollbar-thumb:hover { background: #d1d1d6; }

.sidebar-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.btn-filter-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; border: 1px solid #e5e5ea; padding: 8px 16px; border-radius: 30px; }
.btn-filter-title svg { width: 16px; height: 16px; stroke-width: 2.5; }
.btn-reset { font-size: 12px; color: var(--text-sec); transition: 0.2s; font-weight: 600; }
.btn-reset:hover { color: #ff3b30; }

.filter-group { border-top: 1px solid #f0f0f0; padding: 12px 0; }
.filter-group:first-of-type { border-top: none; padding-top: 0; }
.filter-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  color: inherit;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.filter-header svg { width: 16px; height: 16px; transition: transform 0.3s; stroke: #86868b; }
.filter-header.closed svg { transform: rotate(180deg); }
.filter-content { display: flex; flex-direction: column; gap: 14px; overflow: hidden; transition: 0.3s ease; }
.filter-content.closed { display: none; }

.custom-checkbox { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 13px; font-weight: 500; color: #111; user-select: none; }
.custom-checkbox input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark { height: 18px; width: 18px; background-color: #fff; border: 2px solid #d1d1d6; border-radius: 4px; transition: 0.2s; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.custom-checkbox:hover input ~ .checkmark { border-color: #86868b; }
.custom-checkbox input:checked ~ .checkmark { background-color: #111; border-color: #111; }
.checkmark::after { content: ""; display: none; width: 4px; height: 8px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-1px); }
.custom-checkbox input:checked ~ .checkmark::after { display: block; }

.price-range-wrapper { padding: 10px 0; }
.price-labels { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: #86868b; margin-bottom: 10px; }
.range-slider {
  position: relative;
  width: calc(100% - 18px);
  margin: 15px 9px 10px;
  height: 4px;
  background: #e5e5ea;
  border-radius: 2px;
}
.range-track { position: absolute; height: 100%; background: #111; border-radius: 2px; z-index: 1; left: 0%; right: 0%; }
.range-slider input[type="range"] {
  position: absolute;
  width: 100%;
  height: 4px;
  top: 0;
  left: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  z-index: 2;
  margin: 0;
  padding: 0;
  outline: none;
}
.range-slider input[type="range"]::-webkit-slider-thumb { height: 18px; width: 18px; border-radius: 50%; background: #fff; border: 2px solid #111; pointer-events: auto; -webkit-appearance: none; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); cursor: pointer; transition: transform 0.1s; }
.range-slider input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }

.catalog-content { flex: 1; min-width: 0; }
.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.catalog-found { font-size: 13px; color: #86868b; font-weight: 300; }
.catalog-found span { color: #111; font-weight: 700; }
.toolbar-right { display: flex; align-items: center; gap: 15px; }

.custom-select-wrapper {
  position: relative;
  border: 1px solid #e5e5ea;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 400;
  user-select: none;
  transition: 0.2s;
  background: #fff;
}
.custom-select-wrapper:hover { border-color: #d1d1d6; }
.custom-select-button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; color: #111; font-size: 12px; font-weight: 400; }
.sort-caption { color: #86868b; }
.custom-select-trigger { display: flex; align-items: center; gap: 6px; font-weight: 500; color: #111; }
.cs-arrow { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s ease; }
.custom-select-wrapper.open .cs-arrow { transform: rotate(180deg); }
.custom-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  width: max-content;
  min-width: 220px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 100;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.custom-select-wrapper.open .custom-options { opacity: 1; pointer-events: auto; transform: translateY(0); }
.custom-option { display: block; width: 100%; padding: 12px 20px; color: #111; text-align: left; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.custom-option:hover { background: #f5f5f7; }
.custom-option.selected { color: #ff3b30; background: #fffaf9; }

.catalog-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.catalog-message { grid-column: 1 / -1; margin: 0; padding: 50px; text-align: center; color: #86868b; }
.catalog-message.error { color: #ff3b30; }

.purchase-benefits { margin-top: 40px; border-top: 1px solid rgba(0, 0, 0, 0.06); background: #fff; display: grid; grid-template-columns: repeat(4, 1fr); }
.benefit-item { min-height: 70px; padding: 14px 10px; display: flex; justify-content: center; align-items: center; gap: 16px; position: relative; }
.benefit-item:not(:last-child)::after { content: ""; position: absolute; right: 0; top: 30px; bottom: 30px; width: 1px; background: rgba(0, 0, 0, 0.06); }
.benefit-icon { width: 32px; height: 32px; color: #1d1d1f; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.benefit-icon svg { width: 100%; height: 100%; fill: currentColor; }
.benefit-title { font-size: 13px; font-weight: 700; color: #000; margin-bottom: 4px; }
.benefit-text { font-size: 12px; line-height: 1.4; color: #86868b; font-weight: 500; }

/* Catalog responsive layout replaces the previous stacked sidebar and single-column cards. */
.catalog-filter-toggle { display: none; }
.catalog-dialog { border: 0; padding: 0; color: #171719; }
.custom-checkbox input:focus-visible ~ .checkmark { outline: 2px solid #777; outline-offset: 3px; }
@media (min-width: 768px) and (max-width: 1200px) {
  .catalog-layout { gap: 24px; }
  .catalog-sidebar { width: 220px; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .purchase-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .benefit-item:nth-child(2)::after { display: none; }
}
@media (max-width: 767px) {
  .catalog-body .breadcrumbs { padding: 16px 0 20px; font-size: 9px; line-height: 1.5; }
  .catalog-body .breadcrumbs a { font-weight: 400; }
  .catalog-body .breadcrumbs span { margin: 0 4px; }
  .catalog-header-text { margin-bottom: 12px; }
  .catalog-title { font-size: 22px; line-height: 1.15; letter-spacing: -.035em; margin: 0; }
  .catalog-layout { display: block; margin-bottom: 32px; }
  .catalog-layout > .catalog-sidebar { display: none; }
  .catalog-toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 12px; margin-bottom: 18px; }
  .catalog-found { grid-column: 1 / -1; font-size: 12px; font-weight: 400; }
  .catalog-found span { font-weight: 500; }
  .catalog-filter-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid #e1e1e5; border-radius: 8px; background: #fff; font: 600 11px 'Montserrat', sans-serif; }
  .catalog-filter-toggle svg { width: 17px; height: 17px; }
  #activeFilterCount { font-size: 10px; }
  .toolbar-right { min-width: 0; justify-self: end; }
  .custom-select-wrapper { border-radius: 8px; max-width: 100%; }
  .custom-select-button { min-height: 40px; padding: 8px 10px; font-size: 10px; text-align: left; }
  .custom-select-trigger { min-width: 0; gap: 8px; }
  .cs-arrow { flex: 0 0 14px; }
  .sort-caption { display: none; }
  .catalog-body .catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
  .catalog-body .catalog-grid .card-wrapper { min-width: 0; }
  .catalog-message { padding: 36px 12px; font-size: 13px; line-height: 1.5; }
  .catalog-body { --catalog-benefits-height: 74px; padding-bottom: calc(var(--bottom-nav-height) + var(--catalog-benefits-height)); }
  .catalog-body .mobile-bottom-nav { border: 0; box-shadow: none; }
  .purchase-benefits-wrapper {
    position: fixed; inset: auto 0 var(--bottom-nav-height); z-index: 1090;
    background: #f1f1f3; border: 0;
    backdrop-filter: none; box-shadow: none;
  }
  .purchase-benefits-wrapper .container { padding-inline: var(--mobile-gutter); }
  .purchase-benefits { margin-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 64px; padding: 12px 0; gap: 12px; border: 0; background: transparent; }
  .benefit-item:nth-child(n + 3) { display: none; }
  .benefit-item { justify-content: flex-start; align-items: flex-start; padding: 0; min-height: 0; gap: 8px; }
  .benefit-item::after { display: none; }
  .benefit-icon { width: 23px; height: 23px; }
  .benefit-title { font-size: 10px; line-height: 1.4; }
  .benefit-text { font-size: 9px; }
  .catalog-body .epc-chat-widget { bottom: calc(var(--bottom-nav-height) + var(--catalog-benefits-height) + 14px); }
  .catalog-body .epc-chat-window { max-height: calc(100dvh - var(--bottom-nav-height) - var(--catalog-benefits-height) - 105px); }
  .catalog-body .catalog-grid .card-wrapper { scroll-margin-bottom: calc(var(--bottom-nav-height) + var(--catalog-benefits-height) + 16px); }
  .catalog-body:has(.catalog-dialog[open]) { overflow: hidden; }
  .catalog-dialog {
    position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: none;
    height: min(90dvh, 960px); max-height: 100dvh;
    border-radius: 20px 20px 0 0; background: #fff;
    overflow: hidden; box-shadow: 0 -12px 40px #0002;
  }
  .catalog-dialog[open] { display: flex; flex-direction: column; }
  .catalog-dialog::backdrop { background: #10111499; }
  .catalog-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 20px; min-height: 64px; flex-shrink: 0; border-bottom: 1px solid #ededf0; }
  .catalog-dialog-heading h2 { font-size: 18px; font-weight: 700; margin: 0; }
  .catalog-dialog-heading button { width: 44px; height: 44px; margin-right: -10px; font-size: 27px; font-weight: 300; color: #444; }
  .catalog-dialog-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; flex: 1; padding: 0 20px 20px; }
  .catalog-dialog .catalog-sidebar { width: 100%; max-height: none; position: static; padding: 0; overflow: visible; }
  .catalog-dialog .sidebar-top { display: none; }
  .catalog-dialog .filter-group { padding: 18px 0; border-top: 1px solid #ededf0; }
  .catalog-dialog .filter-group:first-of-type { border-top: 0; }
  .catalog-dialog .filter-header { min-height: 28px; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
  .catalog-dialog .filter-header.closed { margin-bottom: 0; }
  .catalog-dialog .filter-content { gap: 6px; }
  .catalog-dialog .custom-checkbox { min-height: 34px; font-size: 12px; font-weight: 400; gap: 10px; }
  .catalog-dialog .checkmark { border-width: 1px; width: 19px; height: 19px; }
  .catalog-dialog .price-labels { justify-content: flex-start; gap: 16px; font-size: 12px; font-weight: 400; }
  .catalog-dialog .price-labels span + span::before { content: '—'; margin-right: 16px; }
  .catalog-dialog .range-slider { margin-block: 18px; }
  .catalog-dialog .range-slider input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; box-shadow: none; }
  .range-slider input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid #111; pointer-events: auto; }
  .range-slider input:focus-visible::-webkit-slider-thumb { outline: 2px solid #777; outline-offset: 3px; }
  .catalog-filter-footer { flex-shrink: 0; display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; padding: 12px 16px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid #ededf0; background: #fff; }
  .catalog-filter-footer button { min-height: 46px; border-radius: 8px; padding: 10px 8px; background: #f2f2f4; color: #111; font-family: inherit; font-size: 11px; }
  .catalog-filter-footer #applyMobileFilters { background: #080808; color: #fff; font-weight: 600; }
  .catalog-filter-footer #applyMobileFilters:disabled { opacity: .5; }
  .catalog-sort-dialog { height: auto; max-height: 85dvh; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .catalog-sort-dialog .custom-options { position: static; transform: none; opacity: 1; pointer-events: auto; width: 100%; min-width: 0; border: 0; border-radius: 0; box-shadow: none; }
  .catalog-sort-dialog .custom-option { display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 12px 0; font-size: 12px; font-weight: 400; background: #fff; color: #222; }
  .catalog-sort-dialog .custom-option::before { content: ''; width: 22px; height: 22px; flex: 0 0 22px; border: 1px solid #d1d1d6; border-radius: 50%; }
  .catalog-sort-dialog .custom-option.selected::before { background: #111; border-color: #111; box-shadow: inset 0 0 0 4px #fff; }
}

@keyframes catalog-reveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes catalog-panel-enter {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes catalog-backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
  .catalog-header-text, .catalog-toolbar { animation: catalog-reveal .35s ease-out both; }
  .catalog-toolbar { animation-delay: .05s; }
  .catalog-grid .card-wrapper { animation: catalog-reveal .4s ease-out backwards; }
  .catalog-grid .card-wrapper:nth-child(even) { animation-delay: .06s; }
  .catalog-dialog[open] { animation: catalog-panel-enter .28s cubic-bezier(.22, 1, .36, 1); }
  .catalog-dialog[open]::backdrop { animation: catalog-backdrop-enter .2s ease-out; }
  .catalog-dialog .filter-content:not(.closed) { animation: catalog-reveal .2s ease-out; }
  .catalog-filter-toggle, .custom-select-button, .catalog-filter-footer button { transition: background .18s ease, transform .18s ease; }
  .catalog-filter-toggle:active, .custom-select-button:active, .catalog-filter-footer button:active { transform: scale(.97); }
}
