/* Catalog — Flowwow-like custom selects + app mobile */

a,
a:link,
a:visited,
a:hover,
a:active {
  color: inherit;
  text-decoration: none;
}
button {
  color: inherit;
}

.page-catalog {
  background: #f7f5f5;
}

.catalog-app {
  min-height: 100vh;
  background: #f7f5f5;
}

.app-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.app-back,
.app-cart {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #f5f5f5;
  font-size: 22px;
  font-weight: 500;
}

.app-top-title {
  text-align: center;
  display: grid;
  gap: 1px;
}

.app-top-title strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.app-top-title span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.catalog-sticky {
  position: sticky;
  top: 65px;
  z-index: 35;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 10px 0 8px;
}

.catalog-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  background: #fff;
  border-radius: 999px;
  border: 1px solid #e8e8ea;
  margin-bottom: 0;
  position: relative;
}

.catalog-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
}

.search-ico { color: var(--muted); }
.search-clear {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f5f5f5;
  color: var(--muted);
  font-size: 18px;
}


.catalog-main {
  padding: 18px 0 48px;
}

.catalog-head {
  margin: 0 0 14px;
}

.catalog-head h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.03em;
  font-weight: 700;
}

.catalog-head .muted {
  margin: 6px 0 0;
  font-size: 14px;
}

.catalog-filters {
  margin: 0 0 20px;
}

.catalog-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 18px;
}
.catalog-tool-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(80, 40, 45, 0.04);
}
.catalog-tool-btn.is-on {
  border-color: rgba(225, 135, 135, 0.45);
  background: #fff8f8;
}
.catalog-tool-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f4f1f1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--ink);
}
.catalog-tool-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.catalog-tool-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.catalog-tool-copy strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-body {
  overflow: auto;
  max-height: min(58vh, 520px);
  padding-bottom: 8px;
}
.sheet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.sheet-option:has(input:checked) {
  background: #f5f5f5;
}
.sheet-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}
.sheet-group { margin-bottom: 18px; }
.sheet-group-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sheet-chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 0;
  background: #f2f2f2;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.sheet-chip.is-on {
  background: #1f1a1a;
  color: #fff;
}
.sheet-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  cursor: pointer;
}
.sheet-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}
.sheet-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.sheet-actions-split {
  grid-template-columns: 1fr 1.35fr;
}
.sheet-actions .btn,
.sheet-apply,
.sheet-reset {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 0;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sheet-reset {
  background: #f2f2f2;
  color: var(--ink);
}
.sheet-x {
  color: var(--ink);
  display: grid;
  place-items: center;
}
.c-selects-wrap {
  display: none;
  position: relative;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
}

/* Compact Flowwow-like chips */

.c-selects {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.c-selects::-webkit-scrollbar { display: none; }

.c-select {
  position: relative;
  flex: 0 0 auto;
}

.c-select-btn,
.c-select-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  box-shadow: inset 0 0 0 1px rgba(80, 40, 40, 0.1);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.c-select-btn:hover,
.c-select-toggle:hover {
  box-shadow: inset 0 0 0 1px rgba(225, 135, 135, 0.45);
}

.c-select.is-open .c-select-btn,
.c-select.is-on .c-select-btn,
.c-select-toggle.is-on {
  background: #1a1a1a;
  color: #fff;
  box-shadow: none;
}

.c-select-ico {
  display: grid;
  place-items: center;
  opacity: 0.75;
  line-height: 0;
}

.c-select-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.5;
  margin-left: 2px;
  transition: transform 0.15s ease;
}

.c-select.is-open .c-select-caret {
  transform: rotate(180deg);
}

.c-select-toggle.ghost {
  background: transparent;
  box-shadow: inset 0 0 0 1px #ddd;
  color: var(--muted);
}

.c-select-menu {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 220px;
  max-height: min(60vh, 360px);
  overflow: auto;
  padding: 8px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 16px 40px rgba(20, 20, 25, 0.12);
  display: grid;
  gap: 2px;
  z-index: 200;
}

.c-select-menu[hidden] { display: none; }

.c-select-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.c-select-menu a:hover { background: #f5f5f5; }

.c-select-menu a.is-active {
  background: #f5f5f5;
  font-weight: 700;
}

.c-select-menu a.is-active::after {
  content: "✓";
  color: var(--brand);
  font-weight: 700;
}

.c-selects-next {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
}
.c-selects-next:hover { background: #fafafa; }
.c-selects-next[hidden] { display: none; }

/* Catalog product cards — white on gray page */
.page-catalog .catalog-grid .product {
  background: #fff;
  box-shadow: none;
  border: 1px solid rgba(80, 40, 40, 0.07);
  border-radius: 20px;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-catalog .catalog-grid .product-media {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  border-radius: 0;
  overflow: hidden;
  background: #f3eeee;
}

.page-catalog .catalog-grid .product-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.page-catalog .catalog-grid .badge-sale {
  background: #e8f6e8;
  color: #1a7a2e;
  box-shadow: none;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
}

.page-catalog .catalog-grid .fav {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.page-catalog .catalog-grid .product-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 14px;
  min-width: 0;
}

.page-catalog .catalog-grid .product-body h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.page-catalog .catalog-grid .product-comp {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-catalog .catalog-grid .product-foot {
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: auto;
  padding-top: 12px;
}

.page-catalog .catalog-grid .price {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-catalog .catalog-grid .price s {
  display: none;
}

.page-catalog .catalog-grid .add {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 20px;
  line-height: 1;
}

.page-catalog .site-footer {
  margin-top: 24px;
  padding-bottom: calc(88px + var(--safe-bottom));
}

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

.catalog-grid .product {
  border-radius: 20px;
  background: #fff;
}

.catalog-grid .product[hidden] {
  display: none !important;
}

.catalog-more-wrap {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 28px 0 8px;
}
.catalog-more-wrap[hidden] {
  display: none !important;
}

.catalog-more-btn {
  min-width: min(100%, 280px);
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 16px;
  background: #1f1a1a;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(40, 20, 24, 0.12);
  transition: transform 0.15s ease, background 0.15s ease;
}
.catalog-more-btn:hover {
  background: #2c2424;
}
.catalog-more-btn:active {
  transform: scale(0.98);
}
.catalog-more-meta {
  margin: 0;
  font-size: 13px;
}


.c-select-menu[hidden] { display: none; }
.c-selects-next[hidden] { display: none; }
.c-select-ico {
  display: grid;
  place-items: center;
  opacity: 0.75;
  line-height: 0;
}

/* Sheets */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-items: end;
}

.sheet[hidden] { display: none; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 25, 0.4);
}

.sheet-panel {
  position: relative;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(18px + var(--safe-bottom));
  max-height: min(86vh, 720px);
  overflow: auto;
  animation: sheetUp .22s ease;
}

@keyframes sheetUp {
  from { transform: translateY(24px); opacity: .6; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #d8d8dc;
  margin: 4px auto 12px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.sheet-x {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: #f5f5f5;
  font-size: 22px;
  cursor: pointer;
}

.sheet-form h3 {
  margin: 16px 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

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

.chip-option { cursor: pointer; }
.chip-option input { position: absolute; opacity: 0; pointer-events: none; }

.chip-option span {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: #f2f2f2;
  font-size: 13px;
  font-weight: 500;
}

.chip-option input:checked + span {
  background: #1a1a1a;
  color: #fff;
}

.check.big {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 8px;
  font-weight: 600;
}

#filter-sheet .sheet-actions {
  margin-top: 18px;
}
#sort-sheet .sheet-actions {
  grid-template-columns: 1fr;
}
#sort-sheet .sheet-apply {
  width: 100%;
}

.btn-secondary {
  background: #f2f2f2;
  color: var(--ink);
  border: 0;
  border-radius: 14px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-decoration: none;
}

.sort-list {
  display: grid;
  gap: 4px;
  padding-bottom: 8px;
}

.sort-item {
  padding: 14px 12px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 15px;
}

.sort-item.is-active { background: #f5f5f5; }
.sort-item.is-active::after {
  content: " ✓";
  color: var(--brand);
}

body.sheet-open { overflow: hidden; }

@media (min-width: 980px) {
  .page-catalog .tabbar.mobile-only,
  .page-catalog .filter-bar.mobile-only,
  .page-catalog .catalog-tools.mobile-only {
    display: none !important;
  }

  .page-catalog .c-selects-wrap {
    display: flex;
  }

  .catalog-main {
    padding: 22px 0 56px;
  }

  .catalog-head {
    margin-bottom: 16px;
  }

  .catalog-filters {
    margin-bottom: 24px;
  }

  .c-select-btn,
  .c-select-toggle {
    min-height: 42px;
    padding: 0 16px;
    font-size: 14px;
  }

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

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

  .page-catalog .catalog-grid .product-body h3 {
    font-size: 15px;
  }

  .page-catalog .catalog-grid .product-comp {
    font-size: 12px;
  }

  .page-catalog .catalog-grid .price {
    font-size: 18px;
  }

  .page-catalog .catalog-grid .price s {
    display: inline;
  }

  .page-catalog .catalog-grid .add {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .page-catalog .site-footer {
    padding-bottom: 48px;
  }
}
