/* ---------- Catalog hero ---------- */

.cat-hero {
  padding: 28px 0 0;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.crumbs a {
  transition: color 0.3s ease;
}

.crumbs a:hover {
  color: var(--ink);
}

.crumbs [aria-current] {
  color: var(--ink);
}

.cat-hero__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 40px;
  margin-top: 18px;
}

.cat-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 88px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.cat-hero h1 sup {
  margin-left: 8px;
  font-size: 0.24em;
  letter-spacing: 0;
  vertical-align: super;
  color: var(--muted);
}

.cat-hero__lead {
  max-width: 44ch;
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: #4a4a47;
}

/* ---------- Tabs (catalog + cabinet) ---------- */

.cat-tabs,
.cabinet__tabs {
  display: flex;
  gap: 28px;
  margin-top: 32px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.cat-tabs::-webkit-scrollbar,
.cabinet__tabs::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  position: relative;
  flex-shrink: 0;
  padding: 14px 0;
  border: 0;
  background: none;
  font-size: 15px;
  font-weight: 800;
  color: var(--muted);
  transition: color 0.3s ease;
}

.cat-tab span {
  margin-left: 2px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: super;
}

.cat-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transition: transform 0.5s var(--ease);
}

.cat-tab:hover {
  color: var(--ink);
}

.cat-tab.is-active {
  color: var(--ink);
}

.cat-tab.is-active::after {
  transform: scaleX(1);
}

.cat-tab:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- Layout ---------- */

.cat-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 44px;
  padding-top: 28px;
}

/* ---------- Filters ---------- */

.cat-filters {
  position: sticky;
  top: 90px;
  align-self: start;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 110px);
}

.cat-filters__head {
  display: none;
}

.cat-filters__scroll {
  overflow-y: auto;
  padding: 2px 6px 8px 2px;
  scrollbar-width: thin;
}

.cat-filters__foot {
  padding-top: 14px;
}

.cat-filters__foot .apply-btn {
  display: none;
}

.cat-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cat-search:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.06);
}

.cat-search svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.cat-search input {
  width: 100%;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 14px;
  outline: none;
}

.filter-group {
  margin-top: 26px;
}

.filter-group h3 {
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.segmented button {
  padding: 8px 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button.is-active {
  background: var(--ink);
  color: #fff;
}

.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch__track {
  position: relative;
  width: 40px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 999px;
  background: #d9d9d4;
  transition: background 0.4s var(--ease);
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.45s var(--ease), background 0.3s ease;
}

.switch input:checked + .switch__track {
  background: var(--ink);
}

.switch input:checked + .switch__track::after {
  transform: translateX(16px);
  background: var(--lime);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 0 0;
  display: grid;
  gap: 1px;
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.check {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  margin: 0 -8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.25s ease, opacity 0.3s ease;
}

.check:hover {
  background: rgba(17, 17, 17, 0.045);
}

.check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check__box {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1.5px solid #bdbdb8;
  border-radius: 5px;
  transition: background 0.3s var(--ease), border-color 0.3s ease;
}

.check__box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 5px;
  height: 9px;
  border: solid var(--lime);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.35s var(--ease);
}

.check input:checked + .check__box {
  background: var(--ink);
  border-color: var(--ink);
}

.check input:checked + .check__box::after {
  transform: rotate(45deg) scale(1);
}

.check input:focus-visible + .check__box {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.check__label {
  font-size: 14px;
  font-weight: 600;
}

.check__count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.check.is-empty {
  opacity: 0.38;
}

.apply-btn {
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), transform 0.3s var(--ease);
}

.apply-btn:hover {
  background: var(--lime);
  color: var(--ink);
}

.apply-btn:active {
  transform: scale(0.97);
}

/* ---------- Toolbar ---------- */

.cat-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 14px;
  min-height: 44px;
  margin-bottom: 22px;
}

.cat-toolbar__found {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  animation: pop 0.45s var(--ease);
  transition: background 0.3s ease;
}

.active-chip svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.active-chip:hover {
  background: #3a3a38;
}

.sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.sort select {
  appearance: none;
  padding: 10px 36px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 12px center / 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.sort select:hover,
.sort select:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.filters-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.filters-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.filters-toggle__badge {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--lime);
  font-size: 11px;
}

.filters-toggle__badge[hidden] {
  display: none;
}

/* ---------- Product grid ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 16px;
}

.product-card {
  position: relative;
  animation: card-in 0.75s var(--ease) backwards;
  animation-delay: calc(min(var(--i, 0), 12) * 45ms);
  transition: opacity 0.38s var(--ease), transform 0.38s var(--ease);
}

.product-card.is-leaving {
  opacity: 0;
  transform: scale(0.95);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.product-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 16px;
  background: var(--ph, #ebebe8);
}

.product-card__media.has-photo {
  background: #fff;
}

.product-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, 0.65), transparent 70%);
  transition: opacity 0.5s ease, transform 1.1s var(--ease);
}

.product-ph::after {
  content: "DropStash";
  position: absolute;
  bottom: 16px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, 0.3);
}

.product-ph__brand {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: rgba(17, 17, 17, 0.82);
}

.product-ph__type {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, 0.45);
}

.product-card__media img {
  position: absolute;
  inset: 0;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.6s ease, transform 1.1s var(--ease);
}

.product-card__media.has-photo img {
  opacity: 1;
}

.product-card__media.has-photo .product-ph {
  opacity: 0;
}

.product-card:hover .product-card__media img,
.product-card:hover .product-ph {
  transform: scale(1.045);
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  transition: transform 0.35s var(--ease);
}

.fav-btn svg {
  width: 18px;
  height: 18px;
  fill: transparent;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linejoin: round;
  transition: fill 0.3s ease, stroke 0.3s ease;
}

.fav-btn:hover {
  transform: scale(1.08);
}

.fav-btn.is-active svg {
  fill: #ff3b5c;
  stroke: #ff3b5c;
}

.fav-btn.is-popping {
  animation: pop 0.5s var(--ease);
}

.fav-btn:focus-visible,
.product-quick:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.product-quick {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(calc(100% + 14px));
  transition: transform 0.55s var(--ease), opacity 0.4s ease, background 0.35s var(--ease),
    color 0.35s var(--ease);
}

.product-quick svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.45s var(--ease);
}

.product-card:hover .product-quick,
.product-quick:focus-visible {
  opacity: 1;
  transform: none;
}

.product-quick:hover {
  background: var(--lime);
  color: var(--ink);
}

.product-quick:hover svg {
  transform: translateX(4px);
}

.product-card__body {
  padding: 14px 2px 0;
}

.product-card__brand {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.product-card__type {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.product-card__name {
  display: -webkit-box;
  margin: 2px 0 10px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: #3d3d3a;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-badge--adult {
  background: var(--ink);
  color: var(--lime);
  letter-spacing: 0.04em;
}

.product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: -2px 0 12px;
  padding: 0;
  list-style: none;
}

.product-specs li {
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8e8e4;
  font-size: 11px;
  font-weight: 700;
  color: #4a4a47;
  white-space: nowrap;
}

.product-card__price {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.product-card__price.is-request {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Empty / load more ---------- */

.cat-empty {
  padding: 64px 24px;
  border: 1px dashed #c9c9c4;
  border-radius: 24px;
  text-align: center;
}

.cat-empty h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cat-empty p {
  max-width: 40ch;
  margin: 10px auto 22px;
  line-height: 1.5;
  color: var(--muted);
}

.cat-empty__actions {
  display: flex;
  justify-content: center;
  gap: 28px;
}

.load-more {
  max-width: 320px;
  margin: 56px auto 0;
  text-align: center;
}

.load-more p {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.load-more__bar {
  height: 2px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.load-more__bar span {
  display: block;
  height: 100%;
  background: var(--ink);
  transition: width 0.7s var(--ease);
}

.load-more__btn {
  margin-top: 20px;
  padding: 13px 30px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), transform 0.3s var(--ease);
}

.load-more__btn:hover {
  background: var(--ink);
  color: #fff;
}

.load-more__btn:active {
  transform: scale(0.97);
}

.load-more__btn[hidden] {
  display: none;
}

/* ---------- Order by link ---------- */

.link-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  margin: 96px 0;
  padding: 56px 48px;
  border-radius: 28px;
  background: radial-gradient(600px 300px at 90% 0%, rgba(200, 255, 0, 0.16), transparent 70%), #111;
  color: #fff;
}

.link-order h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.link-order p:not(.kicker) {
  max-width: 46ch;
  margin: 14px 0 0;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.7);
}

/* ---------- Responsive ---------- */

@media (hover: none) {
  .product-quick {
    opacity: 1;
    transform: none;
    padding: 10px 12px 10px 14px;
    font-size: 12px;
  }
}

@media (max-width: 900px) {
  .cat-layout {
    grid-template-columns: 1fr;
    padding-top: 20px;
  }

  .filters-toggle {
    display: inline-flex;
  }

  .cat-filters {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    max-height: 86vh;
    padding: 22px 20px 18px;
    border-radius: 24px 24px 0 0;
    background: var(--bg);
    box-shadow: 0 -30px 60px -30px rgba(0, 0, 0, 0.4);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 0.55s var(--ease), visibility 0s 0.55s;
  }

  .filters-open .cat-filters {
    transform: none;
    visibility: visible;
    transition: transform 0.55s var(--ease), visibility 0s;
  }

  .page-catalog::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 85;
    background: rgba(17, 17, 17, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s var(--ease);
  }

  .page-catalog.filters-open::after {
    opacity: 1;
    pointer-events: auto;
  }

  .cat-filters__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }

  .cat-filters__head h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
  }

  .cat-filters__close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #e8e8e4;
  }

  .cat-filters__close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .cat-filters__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--line);
  }

  .cat-filters__foot .apply-btn {
    display: inline-block;
  }

  .active-chips {
    order: 5;
    flex-basis: 100%;
  }

  .link-order {
    grid-template-columns: 1fr;
    padding: 44px 28px;
  }
}

@media (max-width: 600px) {
  .cat-tabs,
  .cabinet__tabs {
    gap: 22px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 10px;
  }

  .sort span {
    display: none;
  }

  .cat-toolbar__found {
    display: none;
  }

  .product-ph {
    padding: 16px 12px;
  }

  .product-ph__brand {
    font-size: 15px;
    overflow-wrap: anywhere;
  }

  .product-ph__type {
    font-size: 9px;
  }

  .product-card__brand {
    font-size: 14px;
  }

  .product-card__name {
    font-size: 13px;
  }

  .product-quick span {
    display: none;
  }

  .product-quick {
    left: auto;
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    opacity: 1;
    transform: none;
  }

  .link-order {
    margin: 72px 0;
    padding: 40px 22px;
  }

  .link-order .order-btn {
    width: 100%;
    justify-content: space-between;
  }
}
