/* =====================================================================
   Multi Textile – shared responsive layer
   Loaded AFTER each page's inline <style>, so it only adds/overrides what
   is needed for small screens. Desktop (>1024px) rules are intentionally
   limited to harmless safety nets that do not change the layout.
   ===================================================================== */

/* ---------- Global safety nets (no visual change on desktop) ---------- */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;            /* fallback for older browsers */
}

@supports (overflow: clip) {
    html,
    body {
        overflow-x: clip;          /* does not create a scroll container */
    }
}

img,
video,
canvas,
svg,
iframe {
    max-width: 100%;
}

img,
video {
    height: auto;
}

/* Grid / flex children must be allowed to shrink below their content size,
   otherwise one long word or a min-height image can widen the whole page. */
[class*="grid"] > *,
[class*="columns"] > *,
.footer-grid > *,
.header-inner > * {
    min-width: 0;
}

h1, h2, h3, h4, h5, h6,
p, li, td, th, a, span, label, button {
    overflow-wrap: break-word;
}

/* Wide tables / code scroll inside their own box instead of the page */
.table-responsive,
table {
    max-width: 100%;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile browsers: dynamic viewport units for full-height bits */
@supports (height: 100dvh) {
    @media (max-width: 768px) {
        .nav-list {
            max-height: calc(100dvh - var(--header-height, 80px));
        }
    }
}

/* ---------- Tablets & below (<= 1024px) ---------- */
@media (max-width: 1024px) {
    .container {
        padding-left: clamp(16px, 4vw, 32px);
        padding-right: clamp(16px, 4vw, 32px);
    }

    /* Multi-column product / detail grids collapse; minmax(0,1fr) lets the
       column shrink instead of being pushed wide by its content. */
    .product-grid,
    .about-grid,
    .content-grid,
    .two-col,
    .split-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- Mobile navigation (<= 768px) ---------- */
@media (max-width: 768px) {

    /* Header keeps one tidy row: logo | quote button | hamburger */
    .site-header .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .header-inner {
        gap: 12px;
    }

    .logo img {
        height: 40px;
        width: auto;
    }

    /* Larger touch target for the hamburger (min 44x44) */
    .nav-toggle {
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        margin-right: -8px;
    }

    /* Animated hamburger -> X when expanded (uses existing 3 spans) */
    .nav-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Menu panel */
    .nav-list {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        align-items: stretch;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .nav-item:last-child {
        border-bottom: 0;
    }

    .nav-item > a {
        padding: 14px 0;
        min-height: 44px;
        font-size: 15px;
    }

    /* Show a +/- chevron on items that expand */
    .nav-item.has-mega > a,
    .nav-item.has-dropdown > a {
        position: relative;
        padding-right: 32px;
    }

    .nav-item.has-mega > a::after,
    .nav-item.has-dropdown > a::after {
        content: "+";
        position: absolute;
        right: 4px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 20px;
        font-weight: 400;
        line-height: 1;
        color: var(--color-gray, #6b7280);
    }

    .nav-item.sub-open > a::after {
        content: "\2212"; /* minus */
    }

    /* Mega menu becomes an inline accordion panel (was hidden with
       !important, which made Products / Industries unreachable). */
    .nav-item.has-mega .mega-menu {
        position: static;
        transform: none;
        left: auto;
        width: 100%;
        max-width: 100%;
        padding: 0 0 8px 12px;
        box-shadow: none;
        background: transparent;
        border: 0;
        border-radius: 0;
    }

    .nav-item.has-mega:not(.sub-open) .mega-menu {
        display: none !important;
    }

    .nav-item.has-mega.sub-open .mega-menu {
        display: block !important;
    }

    .mega-menu-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .mega-column ul li a,
    .dropdown li a {
        padding: 10px 0;
        min-height: 40px;
        font-size: 14px;
    }

    .dropdown li a {
        padding: 10px 12px;
        margin: 0;
    }

    .nav-item.has-dropdown:not(.sub-open) .dropdown {
        display: none !important;
    }

    .nav-item.has-dropdown.sub-open .dropdown {
        display: block !important;
    }

    /* Typography that scales smoothly */
    .page-hero h1 {
        font-size: clamp(26px, 7vw, 34px);
        line-height: 1.2;
    }

    .page-hero-subheadline {
        font-size: clamp(15px, 4.2vw, 18px);
    }

    section h2 {
        font-size: clamp(22px, 6vw, 30px);
        line-height: 1.25;
    }

    .product-info h2 {
        font-size: clamp(22px, 6vw, 28px);
    }

    /* Touch-friendly form controls; 16px stops iOS zooming on focus */
    input,
    select,
    textarea {
        max-width: 100%;
        font-size: 16px;
    }

    button,
    .blob-btn,
    .btn {
        touch-action: manipulation;
    }

    /* Footer links get a comfortable tap size */
    .site-footer a {
        display: inline-block;
        padding-top: 4px;
        padding-bottom: 4px;
    }
}

/* ---------- Narrow tablets (769px - 860px): keep nav clear of the quote button ---------- */
@media (min-width: 769px) and (max-width: 860px) {
    .nav-item > a {
        padding-left: 9px;
        padding-right: 9px;
        font-size: 13px;
    }
}

/* ---------- Small phones (<= 480px) ---------- */
@media (max-width: 480px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .product-detail,
    .page-section {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .blob-btn {
        max-width: 100%;
    }

    .blob-btn--large {
        padding: 14px 28px;
        font-size: 14px;
    }
}

/* ---------- Very small phones (<= 380px) ---------- */
@media (max-width: 380px) {
    .logo img {
        height: 34px;
    }

    .header-inner {
        gap: 8px;
    }

    .blob-btn--header {
        padding: 8px 14px;
        font-size: 11px;
        letter-spacing: 0;
        white-space: nowrap;
    }
}

/* ---------- Landscape phones: keep hero and menu usable ---------- */
@media (max-width: 920px) and (orientation: landscape) and (max-height: 520px) {
    .hero-slider {
        min-height: 420px;
        max-height: none;
    }

    .nav-list {
        max-height: calc(100vh - var(--header-height, 80px));
    }
}

/* ---------- Respect reduced-motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* =====================================================================
   Announcement Bar – single-line continuous marquee (fixed under header)
   ===================================================================== */
.announcement-bar {
    position: fixed;
    top: var(--header-height, 80px);
    left: 0;
    right: 0;
    width: 100%;
    background: #0a3d62; /* primary dark blue */
    color: #ffffff;
    overflow: hidden;
    z-index: 999;
    height: 36px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(155, 205, 49, 0.35);
}

.announcement-bar__track {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    animation: announcement-marquee 40s linear infinite;
    will-change: transform;
}

.announcement-bar:hover .announcement-bar__track {
    animation-play-state: paused;
}

.announcement-bar__content {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    white-space: nowrap;
    padding-right: 4rem; /* gap between loops */
}

.announcement-bar__item {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #ffffff;
    line-height: 1;
}

.announcement-bar__item strong {
    color: #9bcd31; /* secondary green */
    font-weight: 700;
    margin-right: 0.15em;
}

.announcement-bar__sep {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(155, 205, 49, 0.7);
    margin: 0 1.4rem;
    flex-shrink: 0;
}

@keyframes announcement-marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}



/* Reduced motion: show static centered text, no animation */
@media (prefers-reduced-motion: reduce) {
    .announcement-bar__track {
        animation: none;
        justify-content: center;
        width: 100%;
        transform: none;
    }
    .announcement-bar__content:last-child {
        display: none; /* hide the duplicate track */
    }
    .announcement-bar {
        height: auto;
        min-height: 36px;
        padding: 8px 12px;
        justify-content: center;
    }
    .announcement-bar__content {
        flex-wrap: wrap;
        justify-content: center;
        padding-right: 0;
        gap: 0.4rem 0;
    }
    .announcement-bar__sep {
        margin: 0 0.8rem;
    }
}

/* Mobile adjustments – keep single line, smaller type */
@media (max-width: 768px) {
    .announcement-bar {
        height: 32px;
        top: var(--header-height, 80px);
    }
    .announcement-bar__item {
        font-size: 12px;
    }
    .announcement-bar__sep {
        margin: 0 1rem;
    }
    .announcement-bar__content {
        padding-right: 3rem;
    }
    
}

@media (max-width: 480px) {
    .announcement-bar {
        height: 30px;
    }
    .announcement-bar__item {
        font-size: 11px;
    }
    .announcement-bar__sep {
        margin: 0 0.75rem;
        width: 3px;
        height: 3px;
    }
    
}

/* Homepage variant: static bar below hero (not fixed under header) */
.announcement-bar--below-hero {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    z-index: 10;
}

@media (max-width: 768px) {
    }
@media (max-width: 480px) {
    }

@media (max-width: 768px) {
    }
@media (max-width: 480px) {
    }

}

@media (max-width: 768px) {
    }
@media (max-width: 480px) {
    }


/* === FORCE single-line marquee – never stack === */
.announcement-bar,
.announcement-bar--below-hero {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center;
    background: #0a3d62;
    z-index: 10;
    padding: 0 !important;
}

.announcement-bar__track {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: max-content !important;
    animation: announcement-marquee 38s linear infinite;
    will-change: transform;
}

.announcement-bar:hover .announcement-bar__track {
    animation-play-state: paused;
}

.announcement-bar__content {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    white-space: nowrap !important;
    flex-shrink: 0;
    padding-right: 3.5rem;
}

.announcement-bar__item {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    line-height: 1;
    flex-shrink: 0;
}

.announcement-bar__item strong {
    color: #9bcd31;
    font-weight: 700;
    margin-right: 0.2em;
}

.announcement-bar__sep {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(155, 205, 49, 0.75);
    margin: 0 1.25rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .announcement-bar,
    .announcement-bar--below-hero {
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
    }
    .announcement-bar__item {
        font-size: 12px;
    }
    .announcement-bar__sep {
        margin: 0 1rem;
    }
}

@media (max-width: 480px) {
    .announcement-bar,
    .announcement-bar--below-hero {
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
    }
    .announcement-bar__item {
        font-size: 11px;
    }
    .announcement-bar__sep {
        margin: 0 0.85rem;
        width: 3px;
        height: 3px;
    }
}

/* Reduced motion: still single line, just no animation – show first set only */
@media (prefers-reduced-motion: reduce) {
    .announcement-bar__track {
        animation: none !important;
        transform: none !important;
        justify-content: flex-start;
        width: max-content;
    }
    .announcement-bar__content:last-child {
        display: none !important;
    }
    .announcement-bar,
    .announcement-bar--below-hero {
        height: 40px !important;
        overflow: hidden;
        justify-content: center;
    }
    .announcement-bar__content {
        padding-right: 0;
        justify-content: center;
        /* allow slight horizontal scroll if needed rather than wrapping */
        flex-wrap: nowrap !important;
    }
}

}
@media (max-width: 480px) {
    }


/* =====================================================================
   CRITICAL: Announcement bar immediately after hero – ZERO GAP
   ===================================================================== */

/* Hero: no bottom spacing that could create a gap */
.hero-slider {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

/* Bar in normal document flow, right after hero */
.announcement-bar--after-hero {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    display: flex !important;
    align-items: center;
    width: 100%;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: #0a3d62;
    overflow: hidden;
    z-index: 10;
}

/* Single-line marquee (shared track styles already exist; reinforce) */
.announcement-bar--after-hero .announcement-bar__track {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: max-content;
    animation: announcement-marquee 38s linear infinite;
    will-change: transform;
}
.announcement-bar--after-hero:hover .announcement-bar__track {
    animation-play-state: paused;
}
.announcement-bar--after-hero .announcement-bar__content {
    display: flex !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    align-items: center;
    flex-shrink: 0;
    padding-right: 3.5rem;
}
.announcement-bar--after-hero .announcement-bar__item {
    white-space: nowrap !important;
    flex-shrink: 0;
    font-size: 13px;
    color: #fff;
}
.announcement-bar--after-hero .announcement-bar__item strong {
    color: #9bcd31;
    font-weight: 700;
}

/* Next section after bar: no extra top gap from the bar */
.announcement-bar--after-hero + section,
.announcement-bar--after-hero + .who-we-serve {
    margin-top: 0;
}

/* Homepage: do NOT add body padding for this in-flow bar */
body:has(.announcement-bar--after-hero) {
    padding-top: 0 !important;
}

/* Other pages: fixed bar under header still needs offset */
body:has(.announcement-bar:not(.announcement-bar--after-hero)) {
    padding-top: calc(var(--header-height, 80px) + 36px) !important;
}
@media (max-width: 768px) {
    .announcement-bar--after-hero {
        height: 36px;
        min-height: 36px;
        max-height: 36px;
    }
    .announcement-bar--after-hero .announcement-bar__item {
        font-size: 12px;
    }
    body:has(.announcement-bar:not(.announcement-bar--after-hero)) {
        padding-top: calc(var(--header-height, 80px) + 32px) !important;
    }
}
@media (max-width: 480px) {
    .announcement-bar--after-hero {
        height: 34px;
        min-height: 34px;
        max-height: 34px;
    }
    .announcement-bar--after-hero .announcement-bar__item {
        font-size: 11px;
    }
    body:has(.announcement-bar:not(.announcement-bar--after-hero)) {
        padding-top: calc(var(--header-height, 80px) + 30px) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .announcement-bar--after-hero .announcement-bar__track {
        animation: none !important;
    }
    .announcement-bar--after-hero .announcement-bar__content:last-child {
        display: none !important;
    }
}
