/* Products page — layout & visual rhythm */

body.page-products {
    --products-gap: 24px;
    --products-radius: 16px;
}

body.page-products .section {
    padding: 88px 24px;
}

body.page-products .page-hero {
    padding: 148px 24px 72px;
}

body.page-products .featured-section {
    padding: 88px 24px;
}

/* Section headers */
body.page-products .section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 48px;
}

body.page-products .section-header .section-desc {
    margin-left: auto;
    margin-right: auto;
}

/* Filter — sticky flush under fixed navbar, no seam */
body.page-products .navbar.scrolled {
    border-bottom-color: transparent;
    box-shadow: none;
}

body.page-products #gallery .filter-bar {
    position: sticky;
    top: calc(var(--navbar-height, 72px) + env(safe-area-inset-top, 0px));
    z-index: 1195;
    margin: -1px 0 32px;
    padding: 12px 0 14px;
    background: rgba(7, 17, 29, 0.96);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.page-products .filter-btn {
    white-space: nowrap;
}

/* Gallery grid — equal-height cards */
body.page-products .gallery-grid {
    align-items: stretch;
    gap: var(--products-gap);
}

body.page-products .gallery-card {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

body.page-products .gallery-img-wrap {
    aspect-ratio: 16 / 10;
    flex-shrink: 0;
}

body.page-products .gallery-overlay {
    opacity: 1;
    background: linear-gradient(180deg, transparent 35%, rgba(7, 17, 29, 0.75) 100%);
}

body.page-products .gallery-card:hover .gallery-overlay {
    background: linear-gradient(180deg, transparent 20%, rgba(7, 17, 29, 0.9) 100%);
}

body.page-products .gallery-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 0;
}

body.page-products .gallery-body h3 {
    font-size: 16px;
    line-height: 1.35;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}

body.page-products .gallery-body > p {
    font-size: 13px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

body.page-products .gallery-meta {
    margin-top: auto;
    padding-top: 14px;
    gap: 8px 12px;
}

body.page-products .gallery-meta-item {
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.page-products .gallery-meta-item i {
    font-size: 10px;
}

body.page-products .gallery-tags {
    margin-top: 12px;
    gap: 5px;
}

body.page-products .gallery-tag {
    font-size: 9px;
    padding: 3px 8px;
}

/* Featured case studies */
body.page-products .featured-block {
    margin-bottom: 72px;
}

body.page-products .featured-block:last-child {
    margin-bottom: 0;
}

body.page-products .featured-grid {
    gap: 40px;
    align-items: center;
}

body.page-products .featured-img {
    aspect-ratio: 4 / 3;
    max-height: 440px;
    margin: 0 auto;
    width: 100%;
}

body.page-products .featured-text {
    padding: 4px 0;
}

body.page-products .featured-text h2 {
    line-height: 1.2;
}

body.page-products .featured-text p:last-of-type {
    margin-bottom: 0;
}

body.page-products .featured-specs {
    gap: 12px;
    margin-top: 24px;
}

body.page-products .featured-spec {
    padding: 14px 16px;
    border-radius: 12px;
    transition: border-color 0.25s ease, background 0.25s ease;
}

body.page-products .featured-spec:hover {
    border-color: rgba(51, 184, 184, 0.35);
    background: rgba(51, 184, 184, 0.06);
}

/* Close-up grid */
body.page-products .closeup-grid {
    gap: 14px;
}

body.page-products .closeup-card {
    border-radius: var(--products-radius);
}

body.page-products .closeup-label {
    opacity: 1;
    font-size: 11px;
    line-height: 1.35;
    padding: 12px 14px;
}

/* Process strip — desktop grid, mobile horizontal scroll */
body.page-products .process-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

body.page-products .process-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

body.page-products .process-step-img {
    aspect-ratio: 4 / 3;
    width: 100%;
    margin-bottom: 14px;
}

body.page-products .process-step h4 {
    font-size: 13px;
}

body.page-products .process-step p {
    font-size: 11px;
    line-height: 1.45;
    max-width: 200px;
    margin: 0 auto;
}

/* Stats banner */
body.page-products .stats-banner {
    padding: 48px 32px;
    gap: 28px 20px;
    border-radius: var(--products-radius);
}

body.page-products .stat-item {
    position: relative;
    padding: 8px 12px;
}

body.page-products .stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 15%;
    height: 70%;
    width: 1px;
    background: rgba(255, 255, 255, 0.12);
}

body.page-products .stat-item strong {
    font-size: clamp(28px, 4vw, 36px);
}

/* Lightbox */
body.page-products .lightbox-img {
    aspect-ratio: 16 / 10;
    max-height: min(70vh, 520px);
}

body.page-products .lightbox-img img {
    object-fit: cover;
}

body.page-products .lightbox-content {
    max-width: 960px;
}

/* CTA */
body.page-products .cta-wrap {
    padding: 52px 40px;
    border-radius: var(--products-radius);
}

@media (max-width: 1024px) {
    body.page-products .featured-grid .featured-img {
        order: -1;
        max-height: 360px;
    }

    body.page-products .featured-grid.reverse .featured-img {
        order: -1;
    }

    body.page-products .process-strip {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        gap: 14px;
        margin: 0 -24px;
        padding: 16px 24px 28px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(51, 184, 184, 0.4) transparent;
    }

    body.page-products .process-step {
        flex: 0 0 min(200px, 42vw);
        scroll-snap-align: start;
        overflow: visible;
    }

    body.page-products .process-step-num {
        flex-shrink: 0;
        box-sizing: border-box;
        margin-bottom: 12px;
    }

    body.page-products .stat-item:not(:last-child)::after {
        display: none;
    }
}

@media (max-width: 768px) {
    body.page-products .section,
    body.page-products .featured-section {
        padding: 64px 20px;
    }

    body.page-products .page-hero {
        padding: 128px 20px 56px;
    }

    body.page-products .section-header {
        margin-bottom: 36px;
    }

    body.page-products #gallery .section-header {
        margin-bottom: 32px;
    }

    body.page-products #gallery .filter-bar {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-left: -20px;
        margin-right: -20px;
        margin-top: -1px;
        margin-bottom: 24px;
        padding: 10px 20px 12px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
    }

    body.page-products #gallery .filter-bar::-webkit-scrollbar {
        display: none;
    }

    body.page-products .filter-btn {
        flex-shrink: 0;
        padding: 9px 18px;
        font-size: 12px;
    }

    body.page-products .gallery-grid {
        gap: 20px;
    }

    body.page-products .gallery-body {
        padding: 18px 18px 20px;
    }

    body.page-products .gallery-body h3 {
        min-height: 0;
        -webkit-line-clamp: 3;
    }

    body.page-products .featured-block {
        margin-bottom: 48px;
    }

    body.page-products .featured-specs {
        grid-template-columns: 1fr 1fr;
    }

    body.page-products .closeup-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    body.page-products .stats-banner {
        padding: 32px 20px;
        gap: 24px 16px;
    }

    body.page-products .cta-wrap {
        padding: 36px 22px;
    }
}

@media (max-width: 480px) {
    body.page-products .featured-specs {
        grid-template-columns: 1fr;
    }

    body.page-products .closeup-grid {
        grid-template-columns: 1fr 1fr;
    }

    body.page-products .process-step {
        flex: 0 0 78vw;
    }
}
