/* =========================================================
   XinHuan Transformer — Clean & Minimal Design System
   ========================================================= */

:root {
    --xh-ink:        #111827;
    --xh-body:       #374151;
    --xh-muted:      #6b7280;
    --xh-border:     #e5e7eb;
    --xh-bg:         #f9fafb;
    --xh-brand:      #cf0e09;
    --xh-brand-dark: #a00b07;
    --xh-footer:     #111827;
    --xh-white:      #ffffff;
    --radius-sm:     0.5rem;
    --radius-md:     0.875rem;
    --radius-lg:     1.25rem;
}

/* ── Base ─────────────────────────────────────────────── */
body {
    color: var(--xh-body);
    background: var(--xh-white);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--xh-ink);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* ── Typography utilities ────────────────────────────── */
.display-heading {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--xh-ink);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--xh-brand);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: '';
    display: inline-block;
    width: 1.5rem;
    height: 2px;
    background: var(--xh-brand);
    flex-shrink: 0;
}

.lead-text {
    font-size: 1.0625rem;
    color: var(--xh-muted);
    line-height: 1.75;
}

.letter-space { letter-spacing: 0.06em; }

/* ── Spacing ──────────────────────────────────────────── */
/*
 * Scale (desktop → tablet → mobile):
 *   section-space  7rem → 5rem → 3.5rem  — home/about full-bleed sections
 *   py-section     6rem → 4.5rem → 3rem  — standard content sections
 *   py-section-sm  4rem → 2.75rem → 2rem — compact secondary blocks
 *   pb-section     6rem → 4.5rem → 3rem  — bottom-only (after hero)
 *   pb-section-sm  4rem → 2.75rem → 2rem — tighter bottom-only
 *   cta-section    5.5rem → 4rem → 3rem  — CTA band
 *   app-section    6rem → 4.5rem → 3rem  — applications detail sections
 */
.section-space  { padding: 7rem 0; }
.py-section     { padding: 6rem 0; }
.py-section-sm  { padding: 4rem 0; }
.pb-section     { padding-bottom: 6rem; }
.pb-section-sm  { padding-bottom: 4rem; }
.cta-section    { padding: 5.5rem 0; }
.app-section    { padding: 6rem 0; scroll-margin-top: 110px; }

@media (max-width: 991.98px) {
    .section-space  { padding: 5rem 0; }
    .py-section     { padding: 4.5rem 0; }
    .py-section-sm  { padding: 2.75rem 0; }
    .pb-section     { padding-bottom: 4.5rem; }
    .pb-section-sm  { padding-bottom: 2.75rem; }
    .cta-section    { padding: 4rem 0; }
    .app-section    { padding: 4.5rem 0; }
}
@media (max-width: 767.98px) {
    .section-space  { padding: 3.5rem 0; }
    .py-section     { padding: 3rem 0; }
    .py-section-sm  { padding: 2rem 0; }
    .pb-section     { padding-bottom: 3rem; }
    .pb-section-sm  { padding-bottom: 2rem; }
    .cta-section    { padding: 3rem 0; }
    .app-section    { padding: 3rem 0; }
}

/* ── Backgrounds ─────────────────────────────────────── */
.bg-soft       { background: var(--xh-bg); }
.bg-dark-block { background: var(--xh-ink); }

/* ── Navbar ──────────────────────────────────────────── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    transition: background 280ms ease, border-color 280ms ease, box-shadow 280ms ease;
}

.site-header .navbar {
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
    border: none;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 75%);
    backdrop-filter: none;
    transition: inherit;
}

/* Solid state — added by JS on scroll */
.site-header.is-scrolled .navbar {
    background: rgba(255,255,255,0.97);
    border: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

.navbar-brand {
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1;
}

/* Logo swap: light version visible on transparent header (dark hero) */
.logo-nav { display: block; width: auto; }
.logo-nav-light { display: block; }
.logo-nav-dark  { display: none;  }

/* Once scrolled — white navbar — swap to dark logo */
.site-header.is-scrolled .logo-nav-light { display: none;  }
.site-header.is-scrolled .logo-nav-dark  { display: block; }

/* On pages without dark hero the header starts solid — show dark logo */
.site-header.is-opaque .logo-nav-light { display: none;  }
.site-header.is-opaque .logo-nav-dark  { display: block; }

/* Opaque state — solid white navbar with dark text */
.site-header.is-opaque .navbar {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}
.site-header.is-opaque .nav-link {
    color: var(--xh-body) !important;
}
.site-header.is-opaque .nav-link:hover {
    color: var(--xh-ink) !important;
    background: var(--xh-bg);
}
.site-header.is-opaque .nav-hamburger-icon {
    color: var(--xh-ink);
}

.nav-link {
    font-weight: 500;
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.85) !important;
    padding: 0.4rem 0.7rem !important;
    border-radius: var(--radius-sm);
    transition: color 150ms ease, background 150ms ease;
}

.nav-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.08);
}

/* Solid state — dark text on white navbar */
.site-header.is-scrolled .nav-link {
    color: var(--xh-body) !important;
}

.site-header.is-scrolled .nav-link:hover {
    color: var(--xh-ink) !important;
    background: var(--xh-bg);
}

/* Hamburger icon — white on transparent, dark on solid */
.navbar-toggler {
    border: none !important;
}

.nav-hamburger-icon {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1;
}

.site-header.is-scrolled .nav-hamburger-icon {
    color: var(--xh-ink);
}

/* ── Mobile nav collapse ──────────────────────────────── */
@media (max-width: 991.98px) {
    /* Give the expanded drawer a solid dark background */
    .navbar-collapse.show,
    .navbar-collapse.collapsing {
        background: #0d1117;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        border: 1px solid rgba(255,255,255,0.08);
        border-top: none;
        padding: 0.5rem 0.75rem 1rem;
        margin-top: 0.25rem;
    }

    /* Force white links inside mobile dark drawer */
    .navbar-collapse .nav-link {
        color: rgba(255,255,255,0.85) !important;
        border-radius: var(--radius-sm);
        padding: 0.55rem 0.75rem;
    }
    .navbar-collapse .nav-link:hover,
    .navbar-collapse .nav-link:focus {
        color: #fff !important;
        background: rgba(255,255,255,0.07);
    }

    /* Dropdown menus inside mobile nav */
    .navbar-collapse .dropdown-menu {
        background: #161c26;
        border-color: rgba(255,255,255,0.1);
        box-shadow: none;
    }
    .navbar-collapse .dropdown-item {
        color: rgba(255,255,255,0.75);
    }
    .navbar-collapse .dropdown-item:hover {
        background: rgba(255,255,255,0.07);
        color: #fff;
    }
    .navbar-collapse .dropdown-divider {
        border-color: rgba(255,255,255,0.1);
    }

    /* Solid header — swap drawer to light */
    .site-header.is-scrolled .navbar-collapse.show,
    .site-header.is-scrolled .navbar-collapse.collapsing {
        background: #fff;
        border-color: var(--xh-border);
    }
    .site-header.is-scrolled .navbar-collapse .nav-link {
        color: var(--xh-body) !important;
    }
    .site-header.is-scrolled .navbar-collapse .nav-link:hover {
        color: var(--xh-ink) !important;
        background: var(--xh-bg);
    }
    .site-header.is-scrolled .navbar-collapse .dropdown-menu {
        background: #fff;
        border-color: var(--xh-border);
    }
    .site-header.is-scrolled .navbar-collapse .dropdown-item {
        color: var(--xh-body);
    }
    .site-header.is-scrolled .navbar-collapse .dropdown-item:hover {
        background: var(--xh-bg);
        color: var(--xh-ink);
    }

    /* Opaque state — mobile drawer */
    .site-header.is-opaque .navbar-collapse.show,
    .site-header.is-opaque .navbar-collapse.collapsing {
        background: #fff;
        border-color: var(--xh-border);
    }
    .site-header.is-opaque .navbar-collapse .nav-link {
        color: var(--xh-body) !important;
    }
    .site-header.is-opaque .navbar-collapse .nav-link:hover {
        color: var(--xh-ink) !important;
        background: var(--xh-bg);
    }
    .site-header.is-opaque .navbar-collapse .dropdown-menu {
        background: #fff;
        border-color: var(--xh-border);
    }
    .site-header.is-opaque .navbar-collapse .dropdown-item {
        color: var(--xh-body);
    }
    .site-header.is-opaque .navbar-collapse .dropdown-item:hover {
        background: var(--xh-bg);
        color: var(--xh-ink);
    }

    /* RFQ button stays full-width on mobile */
    .navbar-collapse .btn-brand {
        display: block;
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }
}

.dropdown-menu {
    border: 1px solid var(--xh-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(17,24,39,0.1);
    padding: 0.5rem;
    min-width: 14rem;
}

.dropdown-item {
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    color: var(--xh-body);
}

.dropdown-item:hover { background: var(--xh-bg); color: var(--xh-ink); }
.dropdown-item:active { background: var(--xh-brand); color: #fff; }

/* ── Buttons ─────────────────────────────────────────── */
.btn-brand {
    background: var(--xh-brand);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-sm);
    padding: 0.7rem 1.6rem;
    transition: background 180ms ease, transform 120ms ease, box-shadow 180ms ease;
}

.btn-brand:hover, .btn-brand:focus {
    background: var(--xh-brand-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(207,14,9,0.22);
}

.btn-outline-ink {
    background: transparent;
    color: var(--xh-ink);
    border: 1.5px solid #d1d5db;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-sm);
    padding: 0.7rem 1.6rem;
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.btn-outline-ink:hover {
    border-color: var(--xh-ink);
    background: var(--xh-ink);
    color: #fff;
}

.btn-white {
    background: #fff;
    color: var(--xh-ink);
    border: none;
    font-weight: 700;
    font-size: 0.9375rem;
    border-radius: var(--radius-sm);
    padding: 0.875rem 2rem;
    transition: background 180ms ease, transform 120ms ease;
}

.btn-white:hover { background: #f3f4f6; color: var(--xh-ink); transform: translateY(-1px); }

/* ── Hero ────────────────────────────────────────────── */
.hero-section {
    background: #0d1117;    /* deep navy-black for topographic contour look */
    padding-top: 8rem;      /* extra top clears the fixed transparent header */
    padding-bottom: 5.5rem;
    min-height: 680px;
    position: relative;
    overflow: hidden;
}

/* Page-level dark hero (about, applications, customers) — defined after
 * .hero-section so it wins the specificity tie and overrides padding. */
.page-hero {
    padding-top: 6rem;
    padding-bottom: 4.5rem;
    min-height: 0;          /* no forced height — let content determine size */
}

.hero-headline {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    font-size: clamp(2.4rem, 5vw, 3.875rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: #fff;
}

.hero-headline em {
    font-style: italic;
    color: var(--xh-brand);
}

.hero-copy {
    font-size: 1.0625rem;
    color: rgba(255,255,255,0.65);
    max-width: 52ch;
    line-height: 1.75;
}

/* Hero right panel — stats grid */
.hero-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.hero-stat-cell {
    background: rgba(255,255,255,0.04);
    padding: 2.25rem 2rem;
}

.hero-stat-number {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 2.875rem;
    line-height: 1;
    color: #fff;
    letter-spacing: -0.03em;
}

.hero-stat-number sup {
    font-size: 1.4rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--xh-brand);
    vertical-align: super;
}

.hero-stat-label {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.50);
    margin-top: 0.4rem;
    font-weight: 500;
}

/* ── Hero: enhanced CTA buttons ─────────────────────── */
.hero-section .btn-brand {
    box-shadow: 0 2px 8px rgba(207,14,9,0.25);
    transition: background 180ms ease, transform 140ms ease, box-shadow 180ms ease;
}
.hero-section .btn-brand:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(207,14,9,0.40);
}
/* Secondary button — white outline on dark hero */
.hero-section .btn-outline-ink {
    border-color: rgba(255,255,255,0.30);
    color: #fff;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.hero-section .btn-outline-ink:hover {
    border-color: rgba(255,255,255,0.70);
    background: rgba(255,255,255,0.06);
    color: #fff;
    box-shadow: none;
}

/* ── Hero: badge ─────────────────────────────────────── */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--xh-brand);
    background: rgba(207,14,9,0.06);
    border: 1px solid rgba(207,14,9,0.18);
    border-radius: 2rem;
    padding: 0.3rem 0.9rem;
    margin-bottom: 1.25rem;
}

/* ── Hero: topographic-contour animated SVG background ── */
.hero-grid-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.hero-grid-bg svg {
    width: 100%;
    height: 100%;
}

/* Contour lines — three brightness levels */
.topo-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tl-1 { stroke: rgba(207,14,9,0.38); stroke-width: 1.0; }   /* brightest — top contours */
.tl-2 { stroke: rgba(207,14,9,0.20); stroke-width: 0.80; }  /* mid */
.tl-3 { stroke: rgba(207,14,9,0.11); stroke-width: 0.65; }  /* faintest — lower contours */

/* Animated pulse traces */
.topo-pulse {
    fill: none;
    stroke: rgba(207,14,9,0.90);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 16 110;
}
.tp-1 { animation: topo-flow 10s linear infinite;      }
.tp-2 { animation: topo-flow 13s linear infinite 3.5s; }
.tp-3 { animation: topo-flow 11s linear infinite 6.0s; }

@keyframes topo-flow {
    from { stroke-dashoffset:  126; }
    to   { stroke-dashoffset: -126; }
}

/* ── Hero: product image ─────────────────────────────── */
.hero-image-wrap {
    position: relative;
    display: inline-block;
    /* transition set by JS parallax; fallback here */
    transition: transform 0.15s cubic-bezier(0.25,0.46,0.45,0.94);
    will-change: transform;
}
/* Soft glow behind the image */
.hero-image-glow {
    position: absolute;
    inset: 10% 8%;
    background: radial-gradient(ellipse at 50% 60%,
        rgba(207,14,9,0.13) 0%,
        rgba(80,130,200,0.07) 45%,
        transparent 72%);
    filter: blur(38px);
    z-index: 0;
    pointer-events: none;
}
.hero-product-img {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 540px;
    border-radius: 8px;
    display: block;
    /* drop shadow for depth */
    filter: drop-shadow(0 16px 40px rgba(0,0,0,0.10))
            drop-shadow(0 4px 12px rgba(0,0,0,0.06));
}

/* ── Hero: text entrance animation ──────────────────── */
.hero-enter {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.75s ease, transform 0.75s ease;
}
.hero-enter.is-visible {
    opacity: 1;
    transform: none;
}

/* ── Hero: trust row ─────────────────────────────────── */
.hero-trust {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.1rem 1.75rem;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.10);
}
/* Full-width variant below the image grid */
.hero-trust-bottom {
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.10);
}
.hero-trust-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255,255,255,0.55);
    white-space: nowrap;
}
.hero-trust-item i {
    color: var(--xh-brand);
    font-size: 0.875rem;
}

/* ── Company metrics / counters section ──────────────── */
.metrics-strip {
    background: var(--xh-white);
    border-bottom: 1px solid var(--xh-border);
    padding: 2.5rem 0;
}
.metric-item {
    text-align: center;
    padding: 0 1.25rem;
    position: relative;
}
.metric-item + .metric-item::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    height: 2.5rem;
    width: 1px;
    background: var(--xh-border);
}
.metric-number-wrap {
    display: inline-flex;
    align-items: flex-start;
    line-height: 1;
}

.metric-plus {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--xh-brand);
    line-height: 1;
    margin-top: 0.1rem;
}

.metric-number {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 2.5rem;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--xh-ink);
}
.metric-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--xh-muted);
    margin-top: 0.35rem;
    letter-spacing: 0.03em;
}

/* ── Reduced motion overrides ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .hero-enter           { opacity: 1; transform: none; transition: none; }
    .hero-image-wrap      { transition: none; }
    .topo-pulse           { animation: none; opacity: 0.20; }
}

/* ── Stats bar ───────────────────────────────────────── */
.stats-bar {
    border-top: 1px solid var(--xh-border);
    border-bottom: 1px solid var(--xh-border);
    padding: 2.25rem 0;
    background: var(--xh-white);
}

.stats-bar-item {
    text-align: center;
    padding: 0 1rem;
    position: relative;
}

.stats-bar-item + .stats-bar-item::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    height: 2.5rem;
    width: 1px;
    background: var(--xh-border);
}

.stats-bar-number {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 2rem;
    color: var(--xh-ink);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stats-bar-icon {
    display: inline;
    font-size: 1.25rem;
    color: var(--xh-brand);
    margin-right: 0.4rem;
    vertical-align: middle;
}

.stats-bar-label {
    font-size: 0.8125rem;
    color: var(--xh-muted);
    font-weight: 500;
    margin-top: 0.3rem;
}

/* ── Section heading ─────────────────────────────────── */
.section-heading {
    max-width: 54ch;
    margin-bottom: 3rem;
}

.section-heading .h1,
.section-heading h2 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.75rem, 3.5vw, 2.625rem);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

/* ── Cards ───────────────────────────────────────────── */
.product-card,
.feature-box,
.trust-card,
.featured-card {
    padding: 1.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--xh-border);
    background: var(--xh-white);
    transition: transform 240ms ease, box-shadow 240ms ease, border-color 240ms ease;
}

.product-card:hover,
.feature-box:hover,
.trust-card:hover,
.featured-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(17,24,39,0.08);
    border-color: #d1d5db;
}

.feature-icon {
    width: 2.75rem;
    height: 2.75rem;
    background: #fef2f2;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--xh-brand);
    font-size: 1.2rem;
}

/* ── Dark block ──────────────────────────────────────── */
.bg-dark-block .eyebrow { color: var(--xh-brand); }
.bg-dark-block .eyebrow::before { background: var(--xh-brand); }

.text-light-emphasis { color: rgba(255,255,255,0.6); }

.capability-list li {
    color: rgba(255,255,255,0.8);
    padding: 0.875rem 1.25rem;
    border: 1px solid rgba(255,255,255,0.09);
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: 0.9375rem;
}

.capability-list li i {
    color: var(--xh-brand);
    font-size: 1rem;
    flex-shrink: 0;
}

/* ── CTA section ─────────────────────────────────────── */
.cta-section { background: var(--xh-ink); }

.cta-panel {
    border-radius: var(--radius-lg);
    padding: 4rem 3.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
}

.cta-panel .display-heading { color: #fff; }
.cta-panel .lead-text { color: rgba(255,255,255,0.55); }

/* ── Footer ──────────────────────────────────────────── */
.site-footer { background: var(--xh-footer); }

.text-footer {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}

.footer-link {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 150ms ease;
}

.footer-link:hover { color: #fff; }
.footer-divider { border-color: rgba(255,255,255,0.09); }

.footer-logo {
    width: auto;
    display: block;
    /* SVG uses Inter from Google Fonts — renders perfectly in browser */
}

/* ── Products pages ──────────────────────────────────── */
/* Tight bottom on product/utility page heroes — content flows straight in. */
/* Top padding on mobile must override section-space (3.5rem) because the   */
/* fixed navbar is ~56 px and 3.5rem leaves zero breathing room.             */
.products-hero { padding-bottom: 3rem; }
@media (max-width: 767.98px) { .products-hero { padding-top: 5rem; } }

/* Category quick-nav tiles (shown in generic hero) */
.cat-tile-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-decoration: none;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.cat-tile-link:hover {
    background: rgba(255,255,255,0.13);
    border-color: rgba(255,255,255,0.28);
    transform: translateY(-2px);
}
.cat-tile-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    line-height: 1.3;
}
.cat-tile-count {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.04em;
}

/* Category hero banner */
.cat-hero-section {
    position: relative;
    min-height: 380px;
    display: flex;
    align-items: flex-end;
    padding-bottom: 2.5rem;
    padding-top: 7rem;          /* clear fixed header */
    overflow: hidden;
}

.cat-hero-image-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.cat-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.cat-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        rgba(10,12,20,0.82) 0%,
        rgba(10,12,20,0.55) 60%,
        rgba(10,12,20,0.25) 100%
    );
}

.cat-hero-content {
    position: relative;
    z-index: 1;
}

.cat-hero-range-badge {
    display: inline-block;
    background: var(--xh-brand);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.3rem 0.85rem;
    border-radius: 2rem;
    margin-top: 0.5rem;
}

/* ── Product image gallery ── */
.product-gallery-thumbs {
    overflow-x: auto;
    padding-bottom: 0.25rem;
}
.gallery-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--xh-border);
    background: #f8f8f8;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.18s, transform 0.18s;
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.gallery-thumb:hover { border-color: var(--xh-brand); transform: translateY(-2px); }
.gallery-thumb.active { border-color: var(--xh-brand); border-width: 2px; }

/* ── About page hero image ── */
.about-hero-img-wrap {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.about-hero-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}
.about-hero-stats {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 0;
    background: rgba(10,12,20,0.72);
    backdrop-filter: blur(6px);
}
.about-stat-pill {
    flex: 1;
    text-align: center;
    padding: 0.85rem 0.5rem;
    border-right: 1px solid rgba(255,255,255,0.1);
}
.about-stat-pill:last-child { border-right: none; }
.about-stat-num {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}
.about-stat-num sup { font-size: 0.75em; }
.about-stat-lbl {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255,255,255,0.55);
    margin-top: 0.25rem;
}

/* ── Customer case cards ── */
.customer-case-card { transition: transform 0.22s ease, box-shadow 0.22s ease; }
.customer-case-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.12); }
.customer-case-img {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #eee;
}
.customer-case-img img { transition: transform 0.4s ease; }
.customer-case-card:hover .customer-case-img img { transform: scale(1.05); }
.customer-case-sector {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--xh-brand);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}
.customer-case-body { padding: 1.25rem; }
.customer-case-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--xh-ink);
}
.customer-case-desc { font-size: 0.85rem; color: var(--xh-body); margin-bottom: 0; line-height: 1.6; }

/* ── Customer visit photo cards ── */
.visit-photo-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}
.visit-photo {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.visit-photo-card:hover .visit-photo {
    transform: scale(1.04);
}
.visit-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.6rem 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.catalog-stat-card {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--xh-border);
    background: var(--xh-white);
}
.catalog-stat-card .hero-stat-number { color: var(--xh-ink); }
.catalog-stat-card .eyebrow { color: var(--xh-brand); }

.products-filter-form {
    padding: 1.25rem;
    border: 1px solid var(--xh-border);
    border-radius: var(--radius-md);
    background: var(--xh-white);
}

/* ── Facet filter row ──────────────────────────────────── */
.facet-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--xh-border);
    margin-top: 0.25rem;
    align-items: flex-end;
}

.facet-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.facet-filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--xh-muted);
}

/* Voltage class pill radio buttons */
.facet-pill {
    font-size: 0.8rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px !important;
    border-color: var(--xh-border);
    color: var(--xh-ink);
    white-space: nowrap;
    transition: background 180ms, border-color 180ms, color 180ms;
}

.btn-check:checked + .facet-pill {
    background: var(--xh-brand);
    border-color: var(--xh-brand);
    color: #fff;
}

.btn-check:focus + .facet-pill {
    box-shadow: 0 0 0 3px rgba(207,14,9,0.18);
    outline: none;
}

.facet-pill-count {
    display: inline-block;
    font-size: 0.7rem;
    opacity: 0.65;
    margin-left: 0.2em;
}

.btn-check:checked + .facet-pill .facet-pill-count {
    opacity: 0.85;
}

/* Capacity select */
.facet-cap-select {
    min-width: 170px;
    max-width: 200px;
    font-size: 0.85rem;
}

/* ── Facet tags on product cards ─────────────────────── */
.facet-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
    background: #f3f4f6;
    color: var(--xh-muted);
    letter-spacing: 0.02em;
}

.facet-tag--mv {
    background: #eff6ff;
    color: #1d4ed8;
}

.facet-tag--lv {
    background: #f0fdf4;
    color: #15803d;
}

.facet-tag--ps {
    background: #fefce8;
    color: #a16207;
}

/* Card image link */
.catalog-card-img-link {
    display: block;
    text-decoration: none;
    outline: none;
}

.catalog-card {
    padding: 1rem;
    border: 1px solid var(--xh-border);
    border-radius: var(--radius-md);
    background: var(--xh-white);
    transition: transform 240ms ease, box-shadow 240ms ease, border-color 240ms ease;
}

.catalog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(17,24,39,0.08);
    border-color: #d1d5db;
}

.catalog-title-link {
    color: var(--xh-ink);
    text-decoration: none;
    font-weight: 600;
}

.catalog-title-link:hover { color: var(--xh-brand); }

.catalog-image,
.featured-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--xh-border);
    border-radius: var(--radius-sm);
}

/* ── Breadcrumb ──────────────────────────────────────── */
.breadcrumb {
    --bs-breadcrumb-divider-color: var(--xh-muted);
    --bs-breadcrumb-item-active-color: var(--xh-body);
}

.breadcrumb-item a {
    color: var(--xh-body);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--xh-ink);
    text-decoration: underline;
    text-decoration-color: var(--xh-border);
}

/* ── Empty state ─────────────────────────────────────── */
.empty-state {
    padding: 3rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--xh-border);
    background: var(--xh-white);
    text-align: center;
}

/* ── Pagination ──────────────────────────────────────── */
.page-link { color: var(--xh-brand); border-color: var(--xh-border); }
.page-link:hover { color: var(--xh-brand-dark); }
.page-item.active .page-link { background: var(--xh-brand); border-color: var(--xh-brand); }
.page-link:focus { box-shadow: 0 0 0 0.2rem rgba(207,14,9,0.15); }

/* ── RFQ ─────────────────────────────────────────────── */
.rfq-form-card {
    padding: 2rem;
    border: 1px solid var(--xh-border);
    border-radius: var(--radius-md);
    background: var(--xh-white);
}

.prefill-panel {
    padding: 1rem 1.25rem;
    border: 1px solid var(--xh-border);
    border-radius: var(--radius-sm);
    background: var(--xh-bg);
}

.rfq-admin-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.rfq-table-wrap {
    border: 1px solid var(--xh-border);
    border-radius: var(--radius-md);
    background: var(--xh-white);
}

.rfq-table-wrap thead th {
    white-space: nowrap;
    background: var(--xh-bg);
    border-bottom-color: var(--xh-border);
}

/* ── Hero: feature + thumbnails showcase ─────────────── */
.hero-feat-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: 100%;
    max-width: 460px;
}

/* Main featured card */
.hero-feat-main {
    display: block;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    height: 240px;
    background: #1a1f2e;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-feat-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 56px rgba(0,0,0,0.6);
}

.hero-feat-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}

.hero-feat-main:hover img {
    transform: scale(1.04);
}

.hero-feat-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--xh-brand);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.55rem;
    border-radius: 2rem;
    z-index: 2;
}

.hero-feat-main-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.85) 0%,
        rgba(0,0,0,0.4) 45%,
        transparent 100%
    );
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 1rem 1.1rem;
    z-index: 1;
}

.hero-feat-main-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.hero-feat-main-range {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    margin: 0;
}

/* Shared arrow button */
.hero-cat-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--xh-brand);
    color: #fff;
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: transform 0.2s ease, background 0.2s ease;
}

.hero-feat-main:hover .hero-cat-arrow,
.hero-feat-thumb:hover .hero-cat-arrow {
    transform: translateX(2px);
    background: #a00b07;
}

/* Three thumbnails */
.hero-feat-thumbs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.625rem;
}

.hero-feat-thumb {
    display: block;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    text-decoration: none;
    height: 90px;
    background: #1a1f2e;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255,255,255,0.07);
}

.hero-feat-thumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    border-color: rgba(207,14,9,0.4);
}

.hero-feat-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.hero-feat-thumb:hover img {
    transform: scale(1.06);
}

.hero-feat-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.82) 0%,
        rgba(0,0,0,0.2) 60%,
        transparent 100%
    );
    display: flex;
    align-items: flex-end;
    padding: 0.5rem 0.6rem;
}

.hero-feat-thumb-overlay span {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

/* ── Applications visual panels ─────────────────────── */
.app-visual-panel {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
}
.app-visual-stats {
    display: flex;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.app-visual-stat {
    flex: 1;
    padding: 0.6rem 1rem;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.08);
}
.app-visual-stat:last-child { border-right: none; }
.app-visual-stat span {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-serif);
}
.app-visual-stat small {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Applications page ───────────────────────────────── */
.app-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.875rem;
    background: rgba(207,14,9,0.08);
    color: var(--xh-brand);
    font-size: 1.6rem;
    flex-shrink: 0;
}

.app-detail-card {
    background: var(--xh-bg);
    border: 1px solid var(--xh-border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.25rem 1rem;
    height: 100%;
}

.app-detail-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--xh-brand);
    margin-bottom: 0.5rem;
}

.app-detail-text {
    font-size: 0.875rem;
    color: var(--xh-body);
    margin-bottom: 0;
    line-height: 1.6;
}

.app-spec-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    color: var(--xh-body);
    line-height: 1.6;
    display: grid;
    gap: 0.3rem;
}

.app-spec-list li::before {
    content: "–";
    margin-right: 0.4rem;
    color: var(--xh-brand);
    font-weight: 700;
}

.app-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--xh-bg);
    border: 1px solid var(--xh-border);
    border-radius: 2rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--xh-body);
}

.app-divider {
    border: none;
    border-top: 1px solid var(--xh-border);
    margin: 0;
}

/* Industry tiles on home page */
.industry-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--xh-border);
    background: var(--xh-white);
    text-decoration: none;
    color: var(--xh-body);
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.industry-tile:hover {
    border-color: var(--xh-brand);
    box-shadow: 0 4px 18px rgba(207,14,9,0.10);
    transform: translateY(-2px);
    color: var(--xh-ink);
}

.industry-tile .industry-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: rgba(207,14,9,0.07);
    color: var(--xh-brand);
    font-size: 1.4rem;
    transition: background 0.18s;
}

.industry-tile:hover .industry-icon {
    background: rgba(207,14,9,0.13);
}

.industry-tile-name {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

/* ── Scroll-reveal ───────────────────────────────────── */
[data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 650ms cubic-bezier(0.4,0,0.2,1),
                transform 650ms cubic-bezier(0.4,0,0.2,1);
}

[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

[data-reveal-delay="100"] { transition-delay: 100ms; }
[data-reveal-delay="200"] { transition-delay: 200ms; }
[data-reveal-delay="300"] { transition-delay: 300ms; }
[data-reveal-delay="400"] { transition-delay: 400ms; }

/* Keep legacy .reveal class working */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: fade-up 650ms ease forwards;
}

.reveal:nth-child(2) { animation-delay: 80ms; }
.reveal:nth-child(3) { animation-delay: 160ms; }
.reveal:nth-child(4) { animation-delay: 240ms; }

@keyframes fade-up {
    to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive tweaks ───────────────────────────────── */
@media (max-width: 991.98px) {
    .hero-section { padding-top: 6.5rem; padding-bottom: 4rem; }
    .page-hero    { padding-top: 4.5rem; padding-bottom: 3.5rem; }
    .cta-panel { padding: 2.5rem 2rem; }
    .hero-stat-cell { padding: 1.5rem 1.25rem; }
    .hero-stat-number { font-size: 2.25rem; }
    /* Disable parallax visually on tablet and below */
    .hero-image-wrap { transition: none !important; transform: none !important; }
    /* Stack trust items */
    .hero-trust { gap: 0.75rem 1.25rem; }
    /* Metrics */
    .metric-item + .metric-item::before { display: none; }
    .metric-number { font-size: 2rem; }
    .metric-plus { font-size: 1rem; }
}

@media (max-width: 767.98px) {
    .hero-section { padding-top: 5.5rem; padding-bottom: 3rem; }
    /* page-hero: 5rem top ensures content clears fixed navbar (~3.5rem) with breathing room */
    .page-hero    { padding-top: 5rem; padding-bottom: 2.5rem; }
    .hero-headline { font-size: 2.2rem; }
    .cta-panel { padding: 2rem 1.25rem; }
    .stats-bar-item + .stats-bar-item::before { display: none; }
    .stats-bar { padding: 1.75rem 0; }

    /* Products category hero — reduce from fixed 7rem to 5rem on mobile */
    .cat-hero-section { padding-top: 5rem; min-height: 0; }

    /* Applications visual stats — tighten padding so 3 cells fit on narrow screens */
    .app-visual-stat { padding: 0.5rem 0.5rem; }
    .app-visual-stat span { font-size: 0.82rem; }
    .app-visual-stat small { font-size: 0.62rem; }
}

/* ── Image protection ───────────────────────────────────────────────────
 * pointer-events:none on product images blocks drag-to-desktop.
 * Right-click is handled by the JS contextmenu listener in base.html.  */
.catalog-image,
.product-gallery-main img,
.gallery-thumb img {
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

/* Re-enable pointer events on the link wrapper so clicks still work */
.catalog-card-img-link {
    display: block;
    pointer-events: auto;
}
