.shop-hero {
  width: min(100% - 2rem, var(--max, 1200px));
  margin: 1.5rem auto 0;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: var(--radius, 14px);
  background:
    linear-gradient(125deg, #2b2a26 0%, #3d2a24 55%, #e26f4e 140%);
  color: #fff;
  overflow: hidden;
  position: relative;
}

.shop-hero::before {
  content: "";
  position: absolute;
  inset: -20% auto auto 55%;
  width: min(48vw, 420px);
  height: min(48vw, 420px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 68%);
  pointer-events: none;
}

.shop-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 38rem;
}

.shop-kicker {
  margin: 0 0 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
}

.shop-title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display, sans-serif);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 0.98;
}

.shop-lead {
  margin: 0 0 1.35rem;
  color: rgba(255, 255, 255, 0.78);
  max-width: 34ch;
  font-size: 1.05rem;
}

.shop-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.shop-hero .button-secondary {
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

.shop-hero .button-secondary:hover {
  background: #fff;
  color: var(--ink, #0e0e0e);
  border-color: #fff;
}

.catalog-layout {
  width: min(100% - 2rem, var(--max, 1200px));
  margin: 1.35rem auto 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  grid-template-areas: "products categories";
  gap: 1.35rem;
  align-items: start;
}

.catalog-sidebar {
  grid-area: categories;
  position: sticky;
  top: calc(var(--header-h, 4.5rem) + 0.75rem);
  max-height: calc(100vh - var(--header-h, 4.5rem) - 1.5rem);
  overflow-y: auto;
  background: var(--surface, #faf9f6);
  border: 1px solid var(--line, rgba(14, 14, 14, 0.1));
  border-radius: var(--radius, 14px);
  padding: 1.15rem;
  box-shadow: var(--shadow, 0 12px 32px rgba(14, 14, 14, 0.07));
}

.sidebar-title {
  margin: 0 0 0.9rem;
  font-family: var(--font-display, sans-serif);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.my-prints-link {
  display: block;
  margin: 0 0 1rem;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  color: #fff;
  background: var(--accent, #e26f4e);
  transition: transform 0.2s var(--ease, ease);
}

.my-prints-link:hover {
  transform: translateY(-2px);
}

.subcatalog-search,
.search-input {
  width: 100%;
  border: 1px solid var(--line, rgba(14, 14, 14, 0.1));
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
  background: #fff;
}

.subcatalog-search {
  margin-bottom: 0.75rem;
}

.subcatalogs ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.subcatalogs li + li {
  margin-top: 0.25rem;
}

.subcatalogs a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.subcatalogs a:hover {
  background: rgba(14, 14, 14, 0.05);
  color: var(--accent, #ff3b00);
}

.subcatalogs a[aria-current="page"],
.subcatalogs a[aria-current="page"]:hover {
  background: rgba(242, 135, 57, 0.22);
  color: var(--ink, #0e0e0e);
  font-weight: 700;
}

.subcatalogs a.is-ancestor {
  font-weight: 700;
}

.subcatalogs .catalog-children {
  margin: 0.25rem 0 0.5rem 0.75rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--line, rgba(14, 14, 14, 0.1));
  font-size: 0.92rem;
}

.subcatalogs a {
  overflow-wrap: anywhere;
}

.subcatalogs-no-match,
.count,
.clear-link {
  color: var(--muted, #6f6f6f);
  font-size: 0.9rem;
}

.catalog-main {
  grid-area: products;
  min-width: 0;
}

.catalog-toolbar,
.catalog-sort {
  margin-bottom: 0.85rem;
}

.catalog-toolbar {
  background: var(--surface, #faf9f6);
  border: 1px solid var(--line, rgba(14, 14, 14, 0.1));
  border-radius: var(--radius, 14px);
  padding: 0.95rem;
  box-shadow: var(--shadow, 0 12px 32px rgba(14, 14, 14, 0.07));
  display: grid;
  gap: 0.75rem;
}

.search-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.search-submit {
  flex-shrink: 0;
}

.toolbar-meta,
.search-scope,
.sort-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  align-items: center;
}

.option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--ink-2, #2a2a2a);
  font-size: 0.92rem;
}

.chip-sort {
  border: 1px solid var(--line, rgba(14, 14, 14, 0.1));
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  background: var(--surface, #faf9f6);
}

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

.chip-sort.is-active {
  border-color: var(--accent, #ff3b00);
  color: var(--accent, #ff3b00);
  font-weight: 700;
}

.clear-link {
  text-decoration: none;
  white-space: nowrap;
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0.4rem 0 1rem;
}

.catalog-header h1 {
  margin: 0;
}

.count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: var(--radius, 14px);
  overflow: hidden;
  transition: transform 0.35s var(--ease, ease), box-shadow 0.35s ease;
}

.product-card:hover {
  transform: translateY(-7px);
  box-shadow: none;
}

.product-image-wrap {
  aspect-ratio: 3 / 4;
  background: transparent;
  overflow: hidden;
}

.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.6s var(--ease, ease);
}

.product-card:hover .product-image-wrap img {
  transform: scale(1.03);
}

.product-image-wrap img.product-image[data-error="1"] {
  opacity: 0;
}

.product-info {
  padding: 0.9rem 0.95rem 1.05rem;
}

.product-name {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 650;
}

.product-number {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--muted, #666);
}

.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.75rem 0 0.5rem;
}

.pagination-status {
  color: var(--muted, #6f6f6f);
  font-variant-numeric: tabular-nums;
}

.pagination-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.empty-state {
  margin: 0;
  padding: 2rem;
  text-align: center;
  color: var(--muted, #6f6f6f);
  background: var(--surface, #faf9f6);
  border: 1px dashed var(--line, rgba(14, 14, 14, 0.1));
  border-radius: var(--radius, 14px);
}

@media (max-width: 860px) {
  .shop-hero {
    display: none;
  }

  .catalog-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "categories" "products";
    margin: 0.85rem auto 2rem;
    width: min(100% - 1.25rem, var(--max, 1200px));
  }

  .catalog-sidebar {
    position: static;
    max-height: none;
    padding: 0.85rem;
  }

  .catalog-sidebar .subcatalogs {
    max-height: 12rem;
    overflow-y: auto;
  }

  .catalog-toolbar {
    padding: 0.7rem 0.85rem;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .product-info {
    padding: 0.45rem 0.4rem 0.55rem;
  }

  .product-name {
    font-size: 0.72rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-card:hover {
    transform: none;
    box-shadow: none;
  }

  .catalog-header h1 {
    font-size: 1.35rem;
  }
}

.catalog-ranking-note {
  margin: -0.25rem 0 1rem;
  color: var(--muted, #6f6f6f);
  font-size: 0.9rem;
}

.product-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.catalog-cart-dialog {
  width: min(440px, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  box-sizing: border-box;
  padding: 1.25rem;
  border: 1px solid var(--border, #ddd);
  border-radius: 16px;
  color: var(--text, #222);
  background: var(--surface, #fff);
}

.catalog-cart-dialog::backdrop {
  background: rgb(0 0 0 / 45%);
}

.catalog-cart-dialog [hidden] {
  display: none !important;
}

.catalog-cart-dialog fieldset {
  margin: 1rem 0;
  padding: 0;
  border: 0;
}

.catalog-cart-dialog .option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.catalog-cart-dialog .option-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  cursor: pointer;
}

.catalog-cart-dialog .option-chip:has(input:checked) {
  border-color: currentColor;
}

.product-card:has(.product-cart-button) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.product-cart-button {
  margin: auto 0 0;
  border-radius: 0;
  min-height: 44px;
  text-align: center;
  font-size: 0.85rem;
}

@media (hover: hover) and (pointer: fine) {
  .product-card:has(.product-cart-button) {
    display: grid;
    grid-template-rows: auto 1fr;
  }

  .product-card:has(.product-cart-button) .product-card-link {
    display: grid;
    grid-template-rows: subgrid;
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .product-card {
    position: relative;
    overflow: visible;
  }

  .product-card:hover,
  .product-card:focus-within {
    z-index: 2;
  }

  .product-cart-button {
    grid-column: 1;
    grid-row: 2;
    align-self: stretch;
    z-index: 1;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .product-card:hover .product-cart-button,
  .product-card:focus-within .product-cart-button {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .product-card:has(.product-cart-button):hover .product-info,
  .product-card:has(.product-cart-button):focus-within .product-info {
    visibility: hidden;
  }

  .product-card:has(.is-selecting) .product-info {
    visibility: visible;
  }
}

.product-card-link.is-selecting + .product-cart-button {
  visibility: hidden;
}

@media (max-width: 860px) {
  .product-cart-button {
    margin: auto 0 0;
    padding: 0.55rem 0.25rem;
    font-size: 0.7rem;
  }

  @media (hover: hover) and (pointer: fine) {
    .product-cart-button {
      margin: 0;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-cart-button {
    transition: none;
  }
}

/* Personal prints: compact toolbar, selection directly on the cards. */
.my-prints-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.my-prints-toolbar [hidden] {
  display: none;
}

.my-prints-toolbar .button {
  min-height: 44px;
}

#my-prints-status {
  flex-basis: 100%;
  margin: 0;
}

#my-prints-status:empty {
  display: none;
}

.product-card-link.is-selecting {
  position: relative;
  cursor: pointer;
}

.product-card-link.is-selecting::after {
  content: "";
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 1.6rem;
  height: 1.6rem;
  border: 2px solid #a32a24;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
}

.product-card-link.is-selected {
  box-shadow: inset 0 0 0 3px #a32a24;
}

.product-card-link.is-selected::after {
  content: "✓";
  color: #fff;
  background: #a32a24;
}

.product-card-link.is-selecting:focus-visible {
  outline: 3px solid #a32a24;
  outline-offset: -3px;
}

.product-template-button {
  grid-column: 1;
  grid-row: 3;
  align-self: stretch;
  border-radius: 0;
  min-height: 44px;
  padding: 12px 6px;
  font-size: 0.8rem;
  text-align: center;
}
