/* ==========================================================================
   Shop catalog — minimal, practical, responsive
   Scoped to body[data-page="shop"]
   ========================================================================== */

body[data-page="shop"] {
  --shop-ink: #0B1220;
  --shop-muted: #5C6570;
  --shop-line: rgba(15, 23, 42, 0.08);
  --shop-surface: #ffffff;
  --shop-bg: #F6F7F9;
  --shop-accent: #E11D48;
  --shop-radius: 18px;
  --shop-radius-sm: 12px;
  --shop-ease: cubic-bezier(0.22, 1, 0.36, 1);
  background: var(--shop-bg);
  color: var(--shop-ink);
}

body[data-page="shop"] .app-main {
  background: transparent;
}

.shop-catalog {
  padding-block: 4px 40px;
}

.shop-catalog .breadcrumb {
  margin-bottom: 14px;
}

/* ---- Head ---- */
.shop-catalog__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.shop-catalog__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--shop-ink);
}

.shop-catalog__meta {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--shop-muted);
}

.shop-catalog__meta strong {
  color: var(--shop-ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.shop-catalog__psn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #0B1220;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 160ms var(--shop-ease), background 160ms ease;
}

.shop-catalog__psn:hover {
  background: #1a2438;
  color: #fff;
  transform: translateY(-1px);
}

.shop-catalog__psn svg,
.shop-catalog__psn [data-lucide] {
  width: 16px;
  height: 16px;
}

/* ---- Controls ---- */
.shop-catalog__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--shop-surface);
  border: 1px solid var(--shop-line);
  border-radius: var(--shop-radius);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.shop-catalog__search {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  position: relative;
}

.shop-catalog__search-icon {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--shop-muted);
  pointer-events: none;
}

.shop-catalog__search-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px 10px 42px;
  padding-inline-start: 42px;
  padding-inline-end: 96px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--shop-bg);
  font-size: 14.5px;
  font-family: inherit;
  color: var(--shop-ink);
  text-align: right;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.shop-catalog__search-input::placeholder {
  color: #8A939E;
}

.shop-catalog__search-input:focus {
  outline: none;
  background: #fff;
  border-color: rgba(225, 29, 72, 0.28);
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.08);
}

.shop-catalog__search-btn {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: var(--shop-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

.shop-catalog__search-btn:hover {
  filter: brightness(1.05);
}

.shop-catalog__sort {
  margin: 0;
  display: flex;
  align-items: center;
}

.shop-catalog__sort-select {
  min-height: 46px;
  min-width: 150px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--shop-line);
  background: #fff;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  color: var(--shop-ink);
  cursor: pointer;
}

/* ---- Categories ---- */
.shop-catalog__cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 18px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.shop-catalog__cats::-webkit-scrollbar {
  height: 4px;
}

.shop-catalog__cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--shop-line);
  background: var(--shop-surface);
  color: var(--shop-ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.shop-catalog__cat svg,
.shop-catalog__cat [data-lucide] {
  width: 15px;
  height: 15px;
  color: var(--shop-muted);
}

.shop-catalog__cat:hover {
  border-color: rgba(15, 23, 42, 0.14);
  background: #fff;
}

.shop-catalog__cat--active {
  background: var(--shop-ink);
  border-color: var(--shop-ink);
  color: #fff;
}

.shop-catalog__cat--active svg,
.shop-catalog__cat--active [data-lucide] {
  color: #fff;
}

/* ---- Active query chip ---- */
.shop-catalog__filter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -6px 0 16px;
}

.shop-catalog__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(225, 29, 72, 0.08);
  color: var(--shop-accent);
  font-size: 13px;
  font-weight: 700;
}

.shop-catalog__chip-clear {
  color: inherit;
  text-decoration: none;
  opacity: 0.8;
}

.shop-catalog__chip-clear:hover {
  opacity: 1;
}

/* ---- Grid / cards ---- */
body[data-page="shop"] .product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

body[data-page="shop"] .product-card {
  padding: 12px;
  border-radius: var(--shop-radius);
  border: 1px solid var(--shop-line);
  box-shadow: none;
  background: var(--shop-surface);
  gap: 10px;
  transition: transform 180ms var(--shop-ease), border-color 180ms ease, box-shadow 180ms ease;
}

body[data-page="shop"] .product-card:hover {
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

body[data-page="shop"] .product-card__image {
  border-radius: var(--shop-radius-sm);
  background: linear-gradient(180deg, #F3F5F7, #EEF1F4);
}

body[data-page="shop"] .product-card__name {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--shop-ink);
  min-height: 2.9em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body[data-page="shop"] .product-card__price {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--shop-ink);
}

body[data-page="shop"] .product-card .btn {
  border-radius: 12px;
  min-height: 40px;
  font-weight: 800;
}

body[data-page="shop"] .product-card .btn--success {
  background: #16A34A;
  box-shadow: none;
}

body[data-page="shop"] .product-card .btn--primary {
  box-shadow: none;
}

/* ---- Empty ---- */
.shop-catalog__empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 48px 20px;
  background: var(--shop-surface);
  border: 1px solid var(--shop-line);
  border-radius: var(--shop-radius);
}

.shop-catalog__empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--shop-bg);
  color: var(--shop-muted);
  margin-bottom: 6px;
}

.shop-catalog__empty h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
}

.shop-catalog__empty p {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--shop-muted);
}

/* ---- Pagination ---- */
.shop-catalog__pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  padding: 12px;
  background: var(--shop-surface);
  border: 1px solid var(--shop-line);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.shop-catalog__pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 72px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--shop-line);
  background: #fff;
  color: var(--shop-ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.shop-catalog__pager-btn:hover {
  background: var(--shop-bg);
}

.shop-catalog__pager-btn--disabled {
  opacity: 0.35;
  pointer-events: none;
}

.shop-catalog__pager-info {
  font-size: 13px;
  font-weight: 700;
  color: var(--shop-muted);
  white-space: nowrap;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  body[data-page="shop"] .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  body[data-page="shop"] .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .shop-catalog__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .shop-catalog__controls {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .shop-catalog__sort-select {
    width: 100%;
  }

  .shop-catalog__psn {
    width: 100%;
    justify-content: center;
  }

  body[data-page="shop"] .product-card {
    padding: 10px;
  }

  body[data-page="shop"] .product-card__name {
    font-size: 13.5px;
    min-height: 2.8em;
  }

  .shop-catalog__pager {
    width: 100%;
    border-radius: 16px;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="shop"] .product-card,
  .shop-catalog__psn {
    transition: none;
  }
}
