/* ==========================================================================
   COLLECTION PAGE (collection.html), canvas "Collection page (Ware > Use > Series)".
   Markup is filled by js/collectionPage.js. Content font: Aileron, weight 400 only.
   ========================================================================== */
.cl {
    flex: 1;
    width: 100%;
    color: var(--text-primary);
    font-family: 'AileronReg', sans-serif;
    font-weight: 400;
    font-synthesis: none;
    line-height: 1.5;
}

.cl * {
    font-weight: 400;
}

.cl h1,
.cl h2,
.cl p,
.cl ul,
.cl dl {
    margin: 0;
    padding: 0;
}

.cl ul {
    list-style: none;
}

.cl a {
    color: var(--text-primary);
    text-decoration: none;
}

/* ".cl .cl-wrap" beats the ".cl p { margin: 0 }" reset; width: 100% because <main> is a flex
   column (style.css), where auto margins alone would shrink the box to its content. */
.cl .cl-wrap {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: clamp(16px, 4vw, 48px);
    padding-right: clamp(16px, 4vw, 48px);
}

/* Fixed page background: Vanta FOG (js/collectionPage.js) in the ware's colour, behind the
   whole page including the navbar. The left veil keeps the title readable; the dim layer
   (opacity from --fog-dim, set on scroll) darkens it as the products come up. Plain
   background under reduced motion. */
.cl {
    isolation: isolate; /* keeps the fixed layer (z-index: -1) inside this page */
}

.cl-fog-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.cl-fog {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.cl-fog.is-ready {
    opacity: 1;
}

.cl-fog-veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, color-mix(in srgb, var(--c-bg) 55%, transparent) 0%, transparent 65%);
}

.cl-fog-dim {
    position: absolute;
    inset: 0;
    background: var(--c-bg);
    opacity: var(--fog-dim, 0);
}

/* The isolated .cl paints after the footer; lift the footer above the fixed layer. */
.site-footer {
    position: relative;
    z-index: 1;
}

.cl-hero {
    width: 100%;
}

@media (prefers-reduced-motion: reduce) {
    .cl-fog {
        transition: none;
    }
}

/* Head: breadcrumb, title, ware switch */
.cl-head {
    padding-top: clamp(32px, 5vw, 64px);
    padding-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cl-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--c-muted);
}

.cl .cl-crumbs a {
    color: var(--c-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cl .cl-crumbs a:hover,
.cl .cl-crumbs [aria-current] {
    color: var(--text-primary);
}

.cl .cl-crumbs [aria-current] {
    text-decoration: none;
}

.cl-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.cl-title {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.cl-title h1 {
    font-family: 'AileronThin', 'AileronReg', sans-serif;
    font-size: clamp(44px, 6vw, 80px);
    line-height: 1;
}

.cl-title p {
    max-width: 56ch;
    font-size: 17px;
    line-height: 1.6;
    color: var(--c-muted);
}

/* Ware: segmented switch */
.cl-seg {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--c-line);
    background: var(--c-panel);
}

.cl .cl-seg a {
    min-height: 40px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 14px;
    color: var(--c-muted);
    white-space: nowrap;
}

.cl .cl-seg a:hover {
    color: var(--text-primary);
}

.cl .cl-seg a[aria-current] {
    background: var(--text-primary);
    color: var(--c-bg);
}

/* Sticky bar: use tabs + series chips, just under the fixed header */
.cl-bar {
    position: sticky;
    top: 88px;
    z-index: 40;
    border-top: 1px solid var(--c-line);
    border-bottom: 1px solid var(--c-line);
}

/* Frosted glass behind the bar (::after) and, once stuck, behind the strip above it (::before,
   behind the floating header pill): the fog shows through softly, products scrolling under are
   blurred out. Two sibling layers, because a backdrop blur nested inside another one would only
   see its parent. collectionPage.js adds .is-stuck; the header (z-index 10002) stays on top. */
.cl-bar::before,
.cl-bar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: -1;
    background: color-mix(in srgb, var(--c-bg) 62%, transparent);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    pointer-events: none;
}

.cl-bar::after {
    top: 0;
    bottom: 0;
}

.cl-bar::before {
    bottom: 100%;
    height: 96px; /* 88px header strip + the bar's border, with a little overlap */
    opacity: 0;
}

.cl-bar.is-stuck::before {
    opacity: 1;
}

.cl-scroll {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
}

.cl-scroll::-webkit-scrollbar {
    display: none;
}

.cl-uses {
    gap: 32px;
}

.cl .cl-uses a {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    color: var(--c-muted);
    white-space: nowrap;
    box-shadow: inset 0 -2px 0 transparent;
}

.cl .cl-uses a:hover {
    color: var(--text-primary);
}

.cl .cl-uses a[aria-current] {
    color: var(--text-primary);
    box-shadow: inset 0 -2px 0 var(--c-accent);
}

.cl-n {
    font-size: 0.85em;
    color: var(--c-muted);
    font-variant-numeric: tabular-nums;
}

.cl-series-row {
    border-top: 1px solid var(--c-line);
    background: color-mix(in srgb, var(--c-accent) 5%, transparent);
}

.cl-series-in {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.cl-series-label {
    flex-shrink: 0;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-accent);
    white-space: nowrap;
}

.cl-series {
    gap: 8px;
    min-width: 0;
}

.cl .cl-series a {
    min-height: 36px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid var(--c-line);
    font-size: 14px;
    color: var(--c-muted);
    white-space: nowrap;
}

.cl .cl-series a:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.cl .cl-series a[aria-current] {
    border-color: var(--c-accent);
    color: var(--text-primary);
    background: color-mix(in srgb, var(--c-accent) 14%, transparent);
}

@media (max-width: 640px) {
    .cl-series-label {
        display: none;
    }

    .cl-seg {
        width: 100%;
    }

    .cl .cl-seg a {
        flex: 1;
    }
}

/* Result line + grid */
.cl-result {
    padding-top: 24px;
    font-size: 14px;
    color: var(--c-muted);
}

.cl-products {
    padding-top: 16px;
    padding-bottom: clamp(72px, 9vw, 120px);
}

/* Cards */
.pc-grid {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 20px;
}

.pc {
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    background: var(--c-panel);
    border: 1px solid var(--c-line);
    overflow: hidden;
    transition: border-color 0.25s ease;
}

.pc:hover {
    border-color: color-mix(in srgb, var(--c-accent) 60%, transparent);
}

.pc-photo {
    aspect-ratio: 1 / 1;
    background: var(--c-ph);
}

.pc-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pc-ph {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--c-muted);
}

.pc-ph-mark {
    font-size: 22px;
    letter-spacing: 0.08em;
    opacity: 0.45;
}

.pc-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
}

.pc-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.pc-code {
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--c-line);
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--c-muted);
    font-variant-numeric: tabular-nums;
}

.pc-name {
    margin: 0;
    font-family: 'AileronReg', sans-serif;
    font-size: 18px;
    line-height: 1.35;
    color: var(--text-primary);
}

.pc-specs {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    font-size: 14px;
}

.pc-specs dt {
    color: var(--c-muted);
}

.pc-specs dd {
    margin: 0;
    color: var(--text-primary);
}

.pc-add {
    margin-top: auto;
    min-height: 48px;
    border-radius: 999px;
    border: 1px solid var(--cta-gold);
    background: var(--cta-gold);
    color: var(--cta-fg);
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.pc-add:hover {
    background: var(--cta-gold-hover);
    border-color: var(--cta-gold-hover);
}

.pc-add[aria-pressed="true"] {
    background: transparent;
    border-color: var(--c-accent);
    color: var(--c-accent);
}

.pc-add[aria-pressed="true"]::before {
    content: "\2713\00a0";
}

/* Loading placeholders, empty and error states */
.pc-grid > .pc-empty,
.pc-grid > .pc-error {
    grid-column: 1 / -1;
}

.pc-skel {
    aspect-ratio: 3 / 4;
    background: var(--c-panel);
}

.pc-empty {
    padding: 64px 24px;
    border-radius: 20px;
    border: 1px dashed var(--c-line);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: var(--c-muted);
}

.pc-empty p {
    margin: 0;
}

.pc-empty .pc-empty-title {
    font-family: 'AileronThin', 'AileronReg', sans-serif;
    font-size: 26px;
    color: var(--text-primary);
}

.cl .pc-empty a {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 999px;
    border: 1px solid var(--c-line);
    color: var(--text-primary);
    text-decoration: none;
}

.cl .pc-empty a:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.pc-error {
    margin: 0;
    padding: 24px 0;
    color: var(--c-muted);
}

/* Floating inquiry bar (shown while the list has items) */
.cl-inquiry {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 8px 8px 22px;
    border-radius: 999px;
    background: var(--text-primary);
    color: var(--c-bg);
    box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.6);
    font-size: 15px;
    white-space: nowrap;
}

.cl-inquiry[hidden] {
    display: none;
}

.cl .cl-inquiry a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--cta-gold);
    color: var(--cta-fg);
}

.cl .cl-inquiry a:hover {
    background: var(--cta-gold-hover);
}

@media (max-width: 480px) {
    .cl-hide-s {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pc,
    .pc-add {
        transition: none;
    }
}
