/* Catalog page styles: home, hubs, product page, guides, errors. Tokens and components live in
   site.css; this file only adds layout for catalog-specific blocks. */

/* ---------- home hero ---------- */
.page-notice { padding-top: 16px; padding-bottom: 16px; }
.hero {
  position: relative;
  overflow: hidden;
  background-color: #11151B;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center top;
  color: #fff;
  border-bottom: 1px solid #000;
}
.hero-inner { position: relative; z-index: 1; max-width: var(--max); margin: 0 auto; padding: 104px 24px 112px; display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.hero-copy { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero-title { font-size: clamp(44px, 6.2vw, 84px); line-height: 0.98; letter-spacing: -0.04em; font-weight: 700; max-width: 13ch; }
.hero-accent { color: #fff; background: linear-gradient(transparent 62%, #1D4ED8 62%, #1D4ED8 92%, transparent 92%); padding: 0 4px; margin: 0 -4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hero-lead { font-size: 20px; line-height: 1.55; color: #C3C8D0; max-width: 560px; }
.hero-facts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 16px; max-width: 620px; }
.hero-facts li { display: flex; gap: 10px; align-items: flex-start; color: var(--accent-on-dark); }
.hero-facts svg { flex: none; margin-top: 2px; }
.hero-facts span { display: flex; flex-direction: column; font-size: 13px; color: #9CA1AA; }
.hero-facts strong { font-size: 14px; font-weight: 600; color: #fff; }

.hero-watermark { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; pointer-events: none; user-select: none; transform: rotate(-8deg) scale(1.15); }
.hero-watermark span { font-family: var(--mono); font-weight: 600; font-size: clamp(80px, 13vw, 200px); line-height: 1; white-space: nowrap; color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.07); }
.hero-watermark span:nth-child(2) { margin-left: -20vw; }
.hero-watermark span:nth-child(3) { margin-left: 10vw; }
.hero-art { position: relative; flex: 1 1 400px; min-width: 0; display: flex; justify-content: center; align-self: flex-start; margin-top: -32px; }

/* ---------- home sections ---------- */
.home-page { padding-top: 64px; }
.ff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 16px; }
.ff-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.ff-name { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.brand-card { display: flex; flex-direction: column; gap: 14px; }
.brand-name { font-size: 22px; font-weight: 600; color: var(--ink); text-decoration: none; }
.panel-dark .h2 { color: #fff; }
.panel-inner { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; justify-content: space-between; }
.panel-copy { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.panel-steps { flex: 1 1 380px; min-width: 0; font-size: 15px; }
.panel-dark .steps li { color: #fff; }
.guide-card { gap: 8px; padding: 24px; }

/* ---------- hubs ---------- */
.prose-lead { max-width: 760px; }
.hub-form { margin: 0; }
.filter-group { border: 0; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.filter-group legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.filter-actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.filter-actions .btn-block { width: 100%; }
.list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.sort-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sort-select { width: auto; min-width: 200px; }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 24px; }

/* ---------- product page ---------- */
.product-top { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.product-gallery { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.gallery-main { margin: 0; }
.gallery-img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery-thumb { display: block; width: 72px; height: 72px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; overflow: hidden; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumb:hover, .gallery-thumb:focus-visible { border-color: var(--blue); }
.gallery-thumb[aria-current="true"] { border: 2px solid var(--blue); }
.product-info { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.pn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
h1.pn { font-size: clamp(28px, 3vw, 36px); line-height: 1.15; overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.buy-card { display: flex; flex-direction: column; gap: 16px; }
.price-lg { font-size: 26px; }
.stock-line { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.buy-form { margin: 0; }
.buy-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ship-block { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.field-label { font-weight: 600; font-size: 15px; }
.info-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.info-tiles li { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; }
.on-page { display: flex; flex-wrap: wrap; gap: 4px 20px; border-bottom: 1px solid var(--line); padding-bottom: 12px; font-size: 15px; font-weight: 500; }
.on-page a { color: var(--ink); text-decoration: none; }
.on-page a:hover { color: var(--blue); }
.product-page-sections { display: flex; flex-direction: column; gap: 40px; }
.spec { max-width: 900px; }

/* ---------- errors ---------- */
.error-page { max-width: 760px; }

@media (max-width: 640px) {
  .hero-inner { padding: 40px 16px 48px; gap: 36px; }
      .hero-inner { padding: 56px 16px 64px; }
  .hero-watermark span { font-size: 72px; }
  .home-page { padding-top: 40px; }
  .panel-inner { gap: 20px; }
  .guide-card { padding: 18px; }
}

/* ---------- error page ---------- */
.error-search { max-width: 620px; display: flex; flex-direction: column; gap: 10px; }
.error-search .search .input { flex: 1 1 auto; width: auto; min-width: 0; }


/* ---------- hero network animation (partials/hero_network.html) ---------- */
.hero-net { width: 100%; max-width: 520px; height: auto; overflow: visible; }
.hero-net .node-label { font: 600 12px var(--mono); fill: #C9CCC4; letter-spacing: 0.08em; }
.hero-net .hub-label { font: 600 11px var(--mono); fill: #8FA9FF; letter-spacing: 0.12em; }
.hero-net .pulse { stroke-dasharray: 12 100; stroke-dashoffset: 12; animation: net-flow 3s linear infinite; }
.hero-net .pulse.rev { animation-direction: reverse; }
.hero-net .pulse:nth-of-type(1) { animation-duration: 2.6s; animation-delay: 0.0s; }
.hero-net .pulse:nth-of-type(2) { animation-duration: 3.3s; animation-delay: 0.45s; }
.hero-net .pulse:nth-of-type(3) { animation-duration: 4.0s; animation-delay: 0.9s; }
.hero-net .pulse:nth-of-type(4) { animation-duration: 2.6s; animation-delay: 1.35s; }
.hero-net .pulse:nth-of-type(5) { animation-duration: 3.3s; animation-delay: 1.8s; }
.hero-net .pulse:nth-of-type(6) { animation-duration: 4.0s; animation-delay: 2.25s; }
.hero-net .pulse:nth-of-type(7) { animation-duration: 2.6s; animation-delay: 2.7s; }
.hero-net .pulse:nth-of-type(8) { animation-duration: 3.3s; animation-delay: 3.15s; }
.hero-net .pulse:nth-of-type(9) { animation-duration: 4.2s; animation-delay: 0.3s; }
.hero-net .pulse:nth-of-type(10) { animation-duration: 5.4s; animation-delay: 1.5s; }
.hero-net .pulse:nth-of-type(11) { animation-duration: 4.8s; animation-delay: 2.7s; }
.hero-net .pulse:nth-of-type(12) { animation-duration: 4.2s; animation-delay: 3.9s; }
@keyframes net-flow { from { stroke-dashoffset: 12; } to { stroke-dashoffset: -100; } }
.hero-net .ping { transform-box: fill-box; transform-origin: center; animation: net-ping 2.8s ease-out infinite; }
.hero-net .node-wh:nth-child(3n+2) .ping { animation-delay: .9s; }
.hero-net .node-wh:nth-child(3n) .ping { animation-delay: 1.8s; }
@keyframes net-ping { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(2.3); opacity: 0; } }
.hero-net .hub-spin, .hero-net .orbit-2 { transform-box: view-box; transform-origin: 240px 215px; animation: net-spin 40s linear infinite; }
.hero-net .hub-spin { transform-box: fill-box; transform-origin: center; animation-duration: 18s; }
.hero-net .orbit-2 { animation-direction: reverse; animation-duration: 70s; }
@keyframes net-spin { to { transform: rotate(360deg); } }
.hero-net .data-ring { transform-box: view-box; transform-origin: 240px 215px; animation: net-spin 90s linear infinite; }
.hero-net .port { animation: net-blink 2.4s ease-in-out infinite; }
.hero-net .port-2 { animation-delay: 1.2s; }
@keyframes net-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .hero-net .pulse, .hero-net .ping { display: none; }
  .hero-net .hub-spin, .hero-net .orbit-2, .hero-net .port, .hero-net .data-ring { animation: none; }
}

/* ---------- hero globe (static/js/hero-globe.js) ---------- */
.hero-globe-wrap { position: relative; width: 100%; max-width: 560px; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hero-globe { display: none; width: 100%; aspect-ratio: 1; cursor: grab; touch-action: pan-y; }
.hero-globe:active { cursor: grabbing; }
.js .hero-globe { display: block; }
.js .hero-globe-fallback { display: none; }
.hero-globe-fallback { width: 100%; }
.hero-globe-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font: 500 12px var(--mono); color: #9CA1AA; letter-spacing: 0.02em; }
.hero-globe-legend span { display: inline-flex; align-items: center; gap: 8px; }
.lg-wh { width: 9px; height: 9px; border-radius: 50%; background: #3D6FF5; box-shadow: 0 0 0 3px rgba(61, 111, 245, 0.3), 0 0 10px #3D6FF5; }
.lg-route { width: 22px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(143, 169, 255, 0), #fff); }
@media (max-width: 640px) { .hero-globe-legend { font-size: 11px; } }

/* When the hero stacks (copy above globe), no upward shift. */
@media (max-width: 1080px) { .hero-art { align-self: auto; margin-top: 0; } }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.08); border-color: #fff; color: #fff; }

/* Generated product illustration (partials/product_art.html) */
.product-art { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
.hub-search { flex: 1 1 280px; max-width: 420px; }
.hub-search .input { width: 100%; }
.table-products .c-nw { white-space: nowrap; }
.hub-results.htmx-swapping, .htmx-request + .hub-results { opacity: .6; }
.range-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 20px 32px; }
.range-group { display: flex; flex-direction: column; gap: 6px; }
.range-group .h3 { font-size: 17px; }
.range-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.copy-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--muted); cursor: pointer; flex: none; }
.copy-btn:hover, .copy-btn:focus-visible { color: var(--blue); border-color: var(--blue); }
.copy-btn .i-done { display: none; }
.copy-btn.copied { color: var(--green); border-color: currentColor; }
.copy-btn.copied .i-copy { display: none; }
.copy-btn.copied .i-done { display: block; }
.est-list { display: flex; flex-direction: column; gap: 4px; }
.est-list li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tier-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 4px 0 0; }
.tier-table caption { text-align: left; padding-bottom: 6px; }
.tier-table th, .tier-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.tier-table th { font-size: 13px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.tier-table .num { text-align: right; white-space: nowrap; }

/* reviews */
.stars { display: inline-flex; gap: 1px; color: var(--field); font-size: 18px; line-height: 1; }
.stars .on { color: #B45309; }
.rating-summary { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
a.rating-summary:hover { color: var(--blue); }
.review-list { display: flex; flex-direction: column; gap: 12px; max-width: 860px; }
.review { display: flex; flex-direction: column; gap: 10px; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.review-title { font-size: 17px; }
.review-body { color: var(--body); display: flex; flex-direction: column; gap: 8px; overflow-wrap: anywhere; }
.review-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.review-meta .badge { padding: 2px 8px; font-size: 13px; }
.review-reply { border-left: 3px solid var(--blue-line); padding: 4px 0 4px 14px; color: var(--body); display: flex; flex-direction: column; gap: 6px; }
.review-page { max-width: 820px; }
.star-input { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.star-input > legend { padding: 0; margin-bottom: 6px; }
.star-options { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.star-label { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; font-size: 30px; line-height: 1; color: #8A8F87; cursor: pointer; border-radius: var(--r-sm); }
.skip-label { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; margin-left: 8px; border: 1px solid var(--field); border-radius: 999px; color: var(--muted); cursor: pointer; }
/* "N of 5" after the legend once a star is chosen (CSS only, works without JS). */
.star-value > span { display: none; font-weight: 400; color: var(--body); }
.star-input:has(input[value="1"]:checked) .sv-1,
.star-input:has(input[value="2"]:checked) .sv-2,
.star-input:has(input[value="3"]:checked) .sv-3,
.star-input:has(input[value="4"]:checked) .sv-4,
.star-input:has(input[value="5"]:checked) .sv-5 { display: inline; }
.star-options input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 2px; }
.star-options input:checked + .skip-label { background: var(--chip); color: var(--ink); border-color: var(--ink); }
.star-options:has(input[value="1"]:checked) .star-label:nth-of-type(-n+1),
.star-options:has(input[value="2"]:checked) .star-label:nth-of-type(-n+2),
.star-options:has(input[value="3"]:checked) .star-label:nth-of-type(-n+3),
.star-options:has(input[value="4"]:checked) .star-label:nth-of-type(-n+4),
.star-options:has(input[value="5"]:checked) .star-label:nth-of-type(-n+5) { color: #B45309; }
/* Hover: the hovered star and the ones before it light up, the rest go grey. */
@media (hover: hover) {
  .star-options .star-label:hover, .star-options .star-label:has(~ .star-label:hover) { color: #B45309; }
  .star-options:has(.star-label:hover) .star-label:not(:hover):not(:has(~ .star-label:hover)) { color: #8A8F87; }
}
@media (max-width: 640px) {
  .star-options { flex-wrap: nowrap; gap: 0; }
  .star-label { width: 40px; }
  .skip-label { margin-left: 4px; padding: 0 10px; }
}
.review-done { background: var(--chip); }
/* Long product titles as the legend: float keeps the legend inside the card instead of
   straddling the fieldset border. */
.review-item > legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-size: 17px; line-height: 1.35; }
.review-item > legend + * { clear: both; }

/* Department navigation shares the catalogue layout on every page. */
.catalog-menu-cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.menu .menu-panel { position: fixed; left: 16px; right: 16px; top: auto; max-width: calc(100vw - 32px); max-height: 80vh; overflow: auto; width: auto; }
.menu-group { margin: 12px 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
@media (max-width: 900px) { .catalog-menu-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .catalog-menu-cols { display: grid; grid-template-columns: 1fr; } .menu .menu-panel { width: calc(100vw - 32px); } }

.listing-condition { display: block; margin-top: 4px; font-family: var(--sans); }

/* Catalogue disclosure and selection controls. Native details also work without JavaScript. */
.discovery-layout > .filters-side { order: 0; }
.responsive-filters > summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
.responsive-filters .hub-form { padding-top: 12px; }
.platform-disclosure > summary { cursor: pointer; margin-bottom: 12px; }
.platform-options { max-height: 20rem; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.platform-options [hidden] { display: none; }
.selection-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.selection-chips .chip { overflow-wrap: anywhere; max-width: 100%; }
.result-count { font-weight: 600; margin: 12px 0; }
@media (max-width: 900px) {
  .discovery-layout { flex-direction: column; }
  .discovery-layout > .filters-side, .discovery-layout > .main { width: 100%; max-width: none; flex-basis: auto; }
  .responsive-filters { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 16px; }
  .responsive-filters .hub-form { padding-bottom: 16px; }
}
