/* Catalog pages: listing (shop, category, brand, search), product, wishlist, compare.
   Builds on base.css; see docs/architecture.md for the shared components. */

/* ---------- title band with categories ---------- */
.catalog-title { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.catalog-title h1 { margin: 0; }
.catalog-brand { flex: none; width: auto; height: 44px; padding: 4px 8px; border-radius: var(--radius-sm); background: #fff; object-fit: contain; }
.cat-strip { display: flex; gap: 8px; margin: 16px -16px 0; padding: 0 16px 4px; overflow-x: auto; list-style: none; scrollbar-width: none; }
.cat-strip::-webkit-scrollbar { display: none; }
.cat-strip a {
  display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 14px; border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius); background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.cat-strip a:hover { border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .16); }
.cat-strip a.is-active { border-color: #fff; background: #fff; color: var(--brand-dark); }
.cat-strip-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; margin-left: -6px; border-radius: 10px; background: #fff; }
.cat-strip-icon img { width: 26px; height: 26px; object-fit: contain; }
.cat-strip-text { display: grid; line-height: 1.25; }
.cat-strip-text strong { font-size: 14px; font-weight: 600; }
.cat-strip-text small { font-size: 12px; opacity: .75; }
@media (min-width: 992px) {
  .cat-strip { flex-wrap: wrap; margin-inline: 0; padding-inline: 0; overflow: visible; }
}

/* ---------- listing layout ---------- */
.catalog { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.catalog-main { min-width: 0; }
.catalog-intro { margin-bottom: 24px; }
@media (min-width: 992px) {
  .catalog { grid-template-columns: 270px minmax(0, 1fr); gap: 32px; }
  .catalog-plain { grid-template-columns: minmax(0, 1fr); }
  /* The filter drawer is an ordinary sidebar on wide screens. */
  .filters.drawer {
    position: static; z-index: auto; display: block; width: auto; background: none; box-shadow: none;
    transform: none; visibility: visible; transition: none;
  }
  .filters .drawer-head { display: none; }
  .filters .drawer-body { padding: 0; overflow: visible; }
}

.filter-group { padding: 16px 0; border-bottom: 1px solid var(--line); }
.filter-group:first-of-type { padding-top: 0; }
.filter-group h2 { margin: 0 0 12px; font-size: 15px; }
.filter-find { min-height: 38px; margin-bottom: 8px; padding: 6px 12px; }
.filter-options { display: grid; gap: 1px; max-height: 268px; margin: 0; padding: 0 4px 0 0; overflow-y: auto; list-style: none; }
.filter-options label { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 6px; cursor: pointer; }
.filter-options label:hover { background: var(--bg-soft); }
.filter-options input { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.filter-options label > span:first-of-type { flex: 1; min-width: 0; color: var(--ink); }
.filter-options .muted, .filter-links .muted { font-size: 12px; }
.filter-links, .filter-links ul { margin: 0; padding: 0; list-style: none; }
.filter-links { max-height: 340px; padding-right: 4px; overflow-y: auto; }
.filter-links ul { margin: 2px 0 6px 6px; padding-left: 10px; border-left: 2px solid var(--line); }
.filter-links a { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 6px 4px; border-radius: 6px; color: var(--text); text-decoration: none; }
.filter-links a:hover { background: var(--bg-soft); color: var(--brand); }
.filter-links a.is-active { color: var(--brand-dark); font-weight: 700; }
.filter-actions { display: grid; gap: 8px; padding-top: 16px; }

.price-range-track { position: relative; height: 28px; --from: 0%; --to: 100%; }
.price-range-track::before { content: ""; position: absolute; top: 12px; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--line-strong); }
.price-range-fill { position: absolute; top: 12px; left: var(--from); right: calc(100% - var(--to)); height: 4px; border-radius: 2px; background: var(--brand); }
.price-range-track input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 28px; margin: 0; background: none; pointer-events: none;
  -webkit-appearance: none; appearance: none;
}
.price-range-track input[type="range"]::-webkit-slider-runnable-track { height: 28px; background: none; }
.price-range-track input[type="range"]::-moz-range-track { height: 28px; background: none; }
.price-range-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: 4px; border: 2px solid var(--brand);
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); cursor: grab; pointer-events: auto;
}
.price-range-track input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border: 2px solid var(--brand); border-radius: 50%; background: #fff;
  box-shadow: var(--shadow-sm); cursor: grab; pointer-events: auto;
}
.price-range-track input[type="range"]:focus-visible { outline: none; }
.price-range-track input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(28, 110, 164, .25); }
.price-range-inputs { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); }
.price-range-inputs .input { min-width: 0; min-height: 38px; padding: 6px 8px; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.price-range-inputs .input::-webkit-outer-spin-button, .price-range-inputs .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 16px; }
.toolbar-count { order: 3; flex: 1 0 100%; margin: 0; color: var(--muted); font-size: 14px; }
.toolbar-count strong { color: var(--ink); }
.toolbar-tools { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 18px; min-width: 0; }
.toolbar-pick { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.toolbar-pick a { padding: 3px 7px; border-radius: 6px; color: var(--muted); font-weight: 600; text-decoration: none; }
.toolbar-pick a:hover { color: var(--brand); }
.toolbar-pick a.is-active { background: var(--bg-soft); color: var(--ink); }
.toolbar-cols { display: flex; gap: 2px; }
.toolbar-cols a { display: inline-flex; align-items: stretch; gap: 2px; height: 30px; padding: 7px 6px; border-radius: 6px; }
.toolbar-cols a i { width: 4px; border-radius: 1px; background: #c3ccd7; }
.toolbar-cols a:hover i { background: var(--ink); }
.toolbar-cols a.is-active { background: var(--bg-soft); }
.toolbar-cols a.is-active i { background: var(--brand); }
.toolbar-sort { display: flex; flex: 1; gap: 8px; min-width: 0; }
.toolbar-sort select { width: 100%; min-width: 0; min-height: 38px; padding: 6px 10px; }
@media (min-width: 640px) {
  .toolbar-count { order: 0; flex: 0 1 auto; }
  .toolbar-tools { flex: 0 1 auto; margin-left: auto; }
  .toolbar-sort { flex: none; }
  .toolbar-sort select { width: auto; min-width: 210px; }
}

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 12px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark); font-size: 13px; font-weight: 600; text-decoration: none;
}
.chip:hover { background: #d9e9f6; color: var(--brand-dark); }
.chip .icon { width: 14px; height: 14px; }

/* ---------- product page ---------- */
.product-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.product-nav { display: flex; flex: none; gap: 2px; }
.product-nav .btn-icon { width: 34px; height: 34px; color: var(--muted); }
.product { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 992px) { .product { grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 44px; } }

.gallery { min-width: 0; }
.gallery-stage { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.gallery-main { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1; padding: 24px; border: 0; border-radius: var(--radius); background: none; cursor: zoom-in; }
/* The source photos are 360px wide: let them grow a little, but not until they blur. */
.gallery-main img { display: block; width: min(100%, 480px); max-height: 100%; height: auto; object-fit: contain; }
.gallery-empty { color: #b8c2cf; cursor: default; }
.gallery-empty .icon { width: 72px; height: 72px; stroke-width: 1.2; }
.gallery-zoom { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); }
.gallery-main:hover .gallery-zoom { border-color: var(--brand); color: var(--brand); }
.gallery-flag { position: absolute; top: 14px; left: 14px; font-size: 13px; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 12px; padding-bottom: 4px; overflow-x: auto; }
.gallery-thumb { flex: none; width: 72px; height: 72px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery-thumb:hover { border-color: var(--line-strong); }
.gallery-thumb.is-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

.product-summary { min-width: 0; }
.product-title { margin: 0 0 12px; font-size: clamp(20px, 2.4vw, 28px); line-height: 1.3; }
.product-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; color: var(--muted); font-size: 14px; }
.product-meta strong { color: var(--ink); font-weight: 600; }
.product-meta .icon { width: 13px; height: 13px; stroke-width: 3; }
.product-price { margin: 18px 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.1; }
.product-price .price-old { font-size: .55em; }
.product-short { margin-bottom: 18px; font-size: 15px; }
.product-buy { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; }
.product-buy .qty > input { width: 56px; min-height: 50px; }
.product-buy .qty > button { width: 44px; }
.product-buy .btn { flex: 1; min-width: 200px; }
.product-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.product-actions .btn-ghost { padding-inline: 10px; color: var(--text); }
.product-actions .btn-ghost.is-active[data-wishlist-toggle] { color: #d6336c; }
.product-actions .btn-ghost.is-active[data-compare-toggle] { color: var(--brand); }
.product-share { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.product-share .btn-icon { width: 34px; height: 34px; color: var(--muted); }
.product-share .btn-icon:hover { color: var(--brand); }
.product-share .icon { width: 16px; height: 16px; }

.info-box { margin-top: 20px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); font-size: 14px; }
.info-box h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 16px; }
.info-box h2 .icon { color: var(--brand); }
.info-box ul { display: grid; gap: 6px; margin: 0 0 18px; padding-left: 20px; }
.info-box ul:last-child { margin-bottom: 0; }
.info-box strong { color: var(--ink); font-weight: 600; }
.info-box-tags { display: flex !important; flex-wrap: wrap; gap: 6px 18px !important; padding-left: 0 !important; list-style: none; }
.info-box-tags li { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 500; }
.info-box-tags .icon { width: 15px; height: 15px; color: var(--ok); stroke-width: 3; }

.product-tabs { margin-top: 40px; }
.spec-table th { width: 34%; white-space: normal; }

.lightbox { inset: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(8, 20, 33, .88); }
.lightbox img { max-width: min(92vw, 900px); max-height: 86vh; min-width: min(80vw, 420px); border-radius: var(--radius); background: #fff; object-fit: contain; }
.lightbox .btn-icon { position: fixed; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; }
.lightbox .btn-icon:hover { background: rgba(255, 255, 255, .28); color: #fff; }
.lightbox-close { top: 16px; right: 16px; }
.lightbox-prev { top: 50%; left: 16px; margin-top: -22px; }
.lightbox-next { top: 50%; right: 16px; margin-top: -22px; }

/* ---------- wishlist and compare ---------- */
.list-item { display: grid; gap: 6px; grid-template-rows: 1fr auto; min-width: 0; }
.compare-table th[scope="row"] { position: sticky; left: 0; z-index: 1; min-width: 120px; background: var(--bg-soft); white-space: normal; }
.compare-table td { min-width: 190px; vertical-align: top; }
.compare-table thead td { vertical-align: bottom; }
.compare-thumb { display: block; margin-bottom: 10px; }
.compare-thumb img { display: block; width: 150px; height: 150px; margin-inline: auto; object-fit: contain; }
.compare-name { display: block; color: var(--ink); font-weight: 600; line-height: 1.4; text-decoration: none; }
.compare-name:hover { color: var(--brand); }
.compare-actions { display: grid; gap: 6px; justify-items: start; }
