.filters-panel {
  position: sticky;
  top: var(--header-height);
  z-index: 30;
  margin-bottom: 26px;
  padding: 16px;
  border: 1px solid rgba(201, 169, 97, 0.28);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(251, 250, 247, 0.94)),
    var(--color-white);
  box-shadow: 0 18px 52px rgba(25, 20, 13, 0.08);
  backdrop-filter: blur(16px);
}

.gift-finder {
  position: relative;
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid rgba(201, 169, 97, 0.26);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 92% 18%, rgba(201, 169, 97, 0.24), transparent 28%),
    linear-gradient(135deg, rgba(8, 8, 8, 0.98), rgba(22, 20, 16, 0.94)),
    var(--color-ink);
  box-shadow: 0 22px 62px rgba(25, 20, 13, 0.18);
  overflow: hidden;
}

.gift-finder::before {
  content: "";
  position: absolute;
  right: -32px;
  bottom: -54px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(201, 169, 97, 0.16);
  border-radius: 50%;
  box-shadow: inset 0 0 0 28px rgba(201, 169, 97, 0.035);
  pointer-events: none;
}

.gift-finder > * {
  position: relative;
  z-index: 1;
}

.gift-finder-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--color-gold);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gift-finder h2 {
  margin: 0;
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 5vw, 1.65rem);
}

.gift-intents {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.gift-intents::-webkit-scrollbar {
  display: none;
}

.gift-intents button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(201, 169, 97, 0.28);
  border-radius: var(--radius-round);
  color: rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.gift-intents button:hover,
.gift-intents button.active {
  color: var(--color-ink);
  border-color: var(--color-gold);
  background: linear-gradient(135deg, var(--color-gold), #f3dd95);
  transform: translateY(-1px);
}

.filters-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(201, 169, 97, 0.2), transparent 42%, rgba(45, 139, 87, 0.08));
  opacity: 0.75;
  pointer-events: none;
}

.filters-title,
.filters-grid {
  position: relative;
  z-index: 1;
}

.filters-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.filters-title span {
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 800;
}

.filters-title strong {
  flex: 0 0 auto;
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.filters-grid {
  display: grid;
  gap: 10px;
}

.filter-control {
  display: grid;
  gap: 6px;
}

.filter-control label {
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.filter-control .form-select,
.filter-control .form-input {
  min-height: 48px;
  border-color: rgba(201, 169, 97, 0.32);
  color: var(--color-ink);
  background-color: var(--color-white);
  box-shadow: 0 8px 20px rgba(25, 20, 13, 0.04);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.filter-control .form-input::placeholder {
  color: rgba(25, 20, 13, 0.42);
}

.filter-control .form-select:hover,
.filter-control .form-select:focus,
.filter-control .form-input:hover,
.filter-control .form-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 10px 26px rgba(201, 169, 97, 0.12);
  transform: translateY(-1px);
}

.catalog-category {
  padding: 16px 0 36px;
}

.category-head {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.category-head h3 {
  margin: 0;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 5vw, 2.1rem);
  line-height: 1.12;
}

.category-head p {
  margin: 6px 0 0;
  max-width: 650px;
  color: var(--color-muted);
  font-size: clamp(0.94rem, 3.7vw, 1.04rem);
}

.category-count {
  justify-self: start;
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.category-count::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  margin-right: 8px;
  vertical-align: middle;
  background: var(--color-gold);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 14px;
}

.product-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-white);
  box-shadow: var(--shadow-card);
  animation: cardIn 0.45s var(--ease) both;
  transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease), border-color 0.24s var(--ease);
}

.product-card:hover {
  border-color: rgba(201, 169, 97, 0.48);
  box-shadow: 0 18px 48px rgba(25, 20, 13, 0.13);
  transform: translateY(-4px);
}

.product-media {
  position: relative;
  aspect-ratio: 4 / 5;
  width: 100%;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--color-ivory);
}

.product-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%, rgba(201, 169, 97, 0.12));
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease);
}

.product-card:hover .product-media img {
  transform: scale(1.035);
}

.product-card:hover .product-media::after {
  opacity: 1;
}

.product-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: calc(100% - 16px);
}

.product-body {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 10px;
  padding: 13px;
}

.product-sku {
  color: var(--color-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.product-name {
  margin: 0;
  min-height: 2.55em;
  color: var(--color-ink);
  font-size: clamp(0.96rem, 3.4vw, 1.08rem);
  font-weight: 850;
  line-height: 1.28;
}

.product-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  color: var(--color-muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.product-meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-round);
  background: var(--color-ivory);
}

.product-stock {
  color: #1f7a4f;
  border-color: rgba(45, 139, 87, 0.2) !important;
  background: rgba(45, 139, 87, 0.09) !important;
}

.product-stock.is-low {
  color: #8a5a12;
  border-color: rgba(201, 169, 97, 0.3) !important;
  background: rgba(201, 169, 97, 0.12) !important;
}

.product-card-actions {
  display: grid;
  gap: 7px;
  align-self: end;
  margin-top: 4px;
}

.empty-state {
  padding: 36px 18px;
  border: 1px dashed var(--color-gold);
  border-radius: var(--radius-md);
  color: var(--color-muted);
  background: rgba(201, 169, 97, 0.08);
  text-align: center;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 560px) {
  .products-grid {
    gap: 16px;
  }
}

@media (min-width: 900px) {
  .gift-finder {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .gift-intents {
    justify-content: end;
  }

  .filters-grid {
    grid-template-columns: 1.4fr 1fr 1fr 0.85fr;
  }

  .filter-search {
    grid-column: span 1;
  }

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

  .product-card-actions {
    grid-template-columns: 1fr auto;
  }

  .category-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 24px;
  }

  .category-count {
    justify-self: end;
  }
}
