/* =====================================================================
 * NGS Quality Cards — [ngs_quality]  (v1.43.0, approved preview v4)
 *
 * Auto-scrolling "Feel the Quality" strip. Marquee runs on ALL viewports;
 * hover pauses (desktop), touch pauses persistently and the bouncing →
 * (bottom-right) resumes. Cards open a FULL-SCREEN modal (media covers
 * the whole viewport — no empty spots) with a bottom Close pill.
 *
 * Sizes: 4-up desktop · 3-up tablet · 2-up mobile via --ngsq-w/--ngsq-h.
 * All selectors namespaced .ngsq* — !important on media elements defends
 * against theme (Flatsome/Avada) image resets.
 * ===================================================================== */

.ngsq {
    --ngsq-w: 292px;
    --ngsq-h: 336px;
    width: 100%;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}
.ngsq *, .ngsq *::before, .ngsq *::after { box-sizing: inherit; }

/* Standalone header — category archive pages (the accordion supplies the
 * header on product pages). Mirrors the accordion title treatment. */
.ngsq__stdhead {
    padding: 18px 2px 14px;
}
.ngsq__stdtitle {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 22px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    color: #1c1b1b !important;
}

/* ---------- Scroller ----------
   REAL native horizontal scroll so the strip is draggable/swipeable on
   mobile and desktop. JS advances scrollLeft for the auto-marquee and
   pauses on interaction (resuming ~2s later). Scrollbar hidden. */
.ngsq__viewport {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* legacy Edge */
    scroll-behavior: auto;
    overscroll-behavior-x: contain;
}
.ngsq__viewport::-webkit-scrollbar { display: none; height: 0; }
.ngsq__track {
    display: flex;
    gap: 10px;
    width: max-content;
}

/* ---------- Quality Card ---------- */
.ngsq-card {
    position: relative;
    flex: 0 0 var(--ngsq-w);
    width: var(--ngsq-w);
    height: var(--ngsq-h);
    overflow: hidden;
    cursor: pointer;
    background: #1c1b1b;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: left;
    font-family: inherit;
    box-shadow: none !important;
    border-radius: 0 !important;
}
.ngsq-card .ngsq-card__media {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    max-width: none !important;
    border-radius: 0 !important;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ngsq-card:hover .ngsq-card__media { transform: scale(1.05); }
/* Fallback tile when a video card has no poster image set */
.ngsq-card__media--placeholder {
    background: linear-gradient(135deg, #2a2c2e 0%, #17181a 100%);
}
/* The hover-play <video> sits over the poster; no zoom transform so it
   doesn't drift while playing. Poster/scrim/text/badge layering unchanged. */
.ngsq-card__hovervid { transform: none !important; }
.ngsq-card--video { cursor: pointer; }

.ngsq-card__badge {
    position: absolute; top: 12px; right: 12px; z-index: 3;
    background: rgba(0, 0, 0, 0.6); color: #fff;
    font-size: 9.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
    padding: 5px 9px;
    display: inline-flex; align-items: center; gap: 5px;
    backdrop-filter: blur(4px);
    pointer-events: none;
}
.ngsq-card__badge::before { content: "▶"; font-size: 8px; color: #00e5ee; }

.ngsq-card__scrim {
    position: absolute; inset: 38% 0 0 0; z-index: 1; pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.36) 55%, rgba(0,0,0,0) 100%);
}
.ngsq-card__text {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    padding: 14px 15px 15px;
    color: #fff;
    pointer-events: none;
}
.ngsq-card__text h3 {
    margin: 0 0 5px !important;
    padding: 0 !important;
    font-size: 15.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    color: #fff !important;
    text-transform: none !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    line-height: 1.25 !important;
}
.ngsq-card__text h3::before {
    content: ""; display: inline-block; width: 14px; height: 3px;
    background: #00e5ee; margin-right: 7px; vertical-align: 4px;
}
.ngsq-card__text p {
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
    color: rgba(255, 255, 255, 0.88) !important;
    font-weight: 400 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 3em;
    transition: max-height 0.35s ease;
}
.ngsq-card:hover .ngsq-card__text p { -webkit-line-clamp: 5; max-height: 8em; }

/* ---------- CTA card ---------- */
.ngsq-cta {
    position: relative;
    flex: 0 0 var(--ngsq-w);
    width: var(--ngsq-w);
    height: var(--ngsq-h);
    background: #101010;
    color: #fff !important;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 24px 20px;
    text-decoration: none !important;
    overflow: hidden;
    border-radius: 0 !important;
}
.ngsq-cta__bg {
    position: absolute !important; inset: 0 !important; z-index: 0;
    width: 100% !important; height: 100% !important;
    object-fit: cover !important; display: block !important;
    margin: 0 !important; border: 0 !important; max-width: none !important;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ngsq-cta:hover .ngsq-cta__bg { transform: scale(1.05); }
.ngsq-cta__shade { position: absolute; inset: 0; z-index: 1; background: rgba(8, 8, 8, 0.72); }
.ngsq-cta__blob {
    position: absolute !important; border-radius: 50%;
    filter: blur(42px);
    pointer-events: none;
    z-index: 2;
}
.ngsq-cta__blob--cyan {
    width: 210px; height: 210px; left: -50px; top: -40px;
    background: radial-gradient(circle, rgba(0,181,189,0.55), transparent 70%);
    opacity: 0.30;
    animation: ngsq-drift1 15s ease-in-out infinite alternate;
}
.ngsq-cta__blob--warm {
    width: 240px; height: 240px; right: -70px; bottom: -70px;
    background: radial-gradient(circle, rgba(150,110,70,0.6), transparent 70%);
    opacity: 0.26;
    animation: ngsq-drift2 19s ease-in-out infinite alternate;
}
@keyframes ngsq-drift1 { from { transform: translate(0,0) scale(1); }    to { transform: translate(46px, 34px) scale(1.18); } }
@keyframes ngsq-drift2 { from { transform: translate(0,0) scale(1.1); }  to { transform: translate(-40px, -30px) scale(0.95); } }
.ngsq-cta__line1, .ngsq-cta__line2, .ngsq-cta__btn { position: relative; z-index: 3; }
.ngsq-cta__line1 {
    font-size: 12px; font-weight: 600; letter-spacing: 0.24em;
    color: #00e5ee; margin-bottom: 12px; text-transform: uppercase;
}
.ngsq-cta__line2 {
    font-size: 29px; line-height: 1.1; font-weight: 700; letter-spacing: 0.01em;
    text-transform: uppercase; margin-bottom: 22px;
    max-width: 100%;
}
.ngsq-cta__btn {
    display: inline-flex; align-items: center; gap: 9px;
    background: #fff; color: #101010;
    font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    padding: 13px 20px;
    transition: background 0.15s, color 0.15s, gap 0.2s;
}
.ngsq-cta:hover .ngsq-cta__btn { background: #00e5ee; gap: 14px; }
.ngsq-cta__btn::after { content: "→"; font-size: 14px; }

/* ---------- "More to see" bouncing arrow (shown while paused) ---------- */
.ngsq-more {
    position: absolute; right: 10px; bottom: 12px; z-index: 6;
    width: 40px; height: 40px; border-radius: 50% !important;
    border: 0 !important; cursor: pointer;
    background: rgba(10, 10, 10, 0.62) !important; color: #fff !important;
    backdrop-filter: blur(6px);
    display: none; align-items: center; justify-content: center;
    padding: 0 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
    animation: ngsq-nudge 1.9s ease-in-out infinite;
}
.ngsq-more svg { width: 18px; height: 18px; display: block; }
.ngsq.is-paused .ngsq-more { display: inline-flex; }
@keyframes ngsq-nudge {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(7px); }
}

/* ---------- Modal ----------
   Mobile (<900px): full-screen takeover — media COVERS, text over a bottom
   scrim. Desktop (>=900px): centered lightbox — media LEFT (contained, no
   crop, letterboxed on dark), text panel RIGHT. */
.ngsq-modal {
    position: fixed; inset: 0; z-index: 999999;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex; align-items: center; justify-content: center;
}
.ngsq-modal.is-open { opacity: 1; pointer-events: auto; }

/* Backdrop — the dark blur behind the desktop lightbox (fully covered by the
   card on mobile, so harmless there). Clicking it closes. */
.ngsq-modal__backdrop {
    position: absolute; inset: 0; z-index: 0;
    background: rgba(8, 9, 10, 0.9);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    cursor: pointer;
}

.ngsq-modal__card {
    position: relative; z-index: 1;
    width: 100vw; height: 100vh; height: 100dvh;
    background: #000; overflow: hidden;
    transform: translateY(30px);
    transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.ngsq-modal.is-open .ngsq-modal__card { transform: translateY(0); }

.ngsq-modal__split { position: relative; width: 100%; height: 100%; }

/* Media area */
.ngsq-modal__media { position: absolute; inset: 0; z-index: 0; }
.ngsq-modal__mediahost { position: absolute; inset: 0; }
.ngsq-modal__mediahost img,
.ngsq-modal__mediahost video,
.ngsq-modal__mediahost iframe {
    position: absolute !important; inset: 0 !important; z-index: 0;
    width: 100% !important; height: 100% !important;
    object-fit: cover !important; object-position: center !important;
    display: block !important; margin: 0 !important; border: 0 !important;
    max-width: none !important; background: #0c0d0e;
}

/* Body (text) */
.ngsq-modal__body {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    color: #fff;
}
.ngsq-modal__scrim {
    position: absolute; inset: -170px 0 0 0; z-index: 0; pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 48%, rgba(0,0,0,0) 100%);
}
.ngsq-modal__body-inner {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: flex-start;
    padding: 0 26px calc(20px + env(safe-area-inset-bottom, 0px));
}
.ngsq-modal__body h3 {
    margin: 0 0 8px !important;
    font-size: 22px !important; font-weight: 700 !important;
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.ngsq-modal__body h3::before {
    content: ""; display: inline-block; width: 18px; height: 3px;
    background: #00e5ee; margin-right: 9px; vertical-align: 5px;
}
.ngsq-modal__body p {
    margin: 0 0 18px !important;
    font-size: 14px !important; font-weight: 400 !important; line-height: 1.6 !important;
    color: rgba(255, 255, 255, 0.92) !important;
    max-width: 680px;
}
.ngsq-modal__closepill {
    align-self: center;
    background: rgba(0, 0, 0, 0.35) !important; color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    border-radius: 999px !important;
    font-size: 11.5px !important; font-weight: 700 !important;
    letter-spacing: 0.14em !important; text-transform: uppercase !important;
    padding: 9px 26px !important; cursor: pointer;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ngsq-modal__closepill:hover { background: #fff !important; color: #101010 !important; border-color: #fff !important; }
.ngsq-modal__close {
    position: absolute; top: 14px; right: 14px; z-index: 4;
    width: 42px; height: 42px; border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    color: #fff !important;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    font-size: 17px; line-height: 1; padding: 0 !important;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    transition: background 0.15s, color 0.15s;
}
.ngsq-modal__close:hover { background: #fff !important; color: #101010 !important; }
body.ngsq-modal-open { overflow: hidden; }

/* ===== Desktop lightbox (>=900px) — split: media left, text right ===== */
@media (min-width: 900px) {
    .ngsq-modal__card {
        width: min(1040px, 92vw);
        height: min(620px, 86vh);
        border-radius: 6px;
        box-shadow: 0 30px 90px rgba(0,0,0,0.6);
        transform: translateY(24px) scale(0.985);
    }
    .ngsq-modal.is-open .ngsq-modal__card { transform: translateY(0) scale(1); }

    .ngsq-modal__split { display: flex; align-items: stretch; }

    /* Media LEFT — contained (whole photo/video, no crop) on a dark letterbox */
    .ngsq-modal__media {
        position: relative; inset: auto;
        flex: 0 0 62%; width: 62%;
        background: #0c0d0e;
    }
    .ngsq-modal__mediahost img,
    .ngsq-modal__mediahost video { object-fit: contain !important; background: transparent; }
    /* iframes can't object-fit; fill the media column (16:9 embeds sit fine) */
    .ngsq-modal__mediahost iframe { object-fit: fill !important; }

    /* Text RIGHT — its own panel, vertically centered, scrolls if long */
    .ngsq-modal__body {
        position: relative; inset: auto;
        flex: 0 0 38%; width: 38%;
        display: flex; align-items: center;
        background: #161718;
        overflow-y: auto;
    }
    .ngsq-modal__scrim { display: none; }
    .ngsq-modal__body-inner { padding: 34px 32px; }
    .ngsq-modal__body h3 { font-size: 24px !important; }
    .ngsq-modal__body p  { font-size: 15px !important; margin-bottom: 24px !important; color: rgba(255,255,255,0.8) !important; }
    .ngsq-modal__closepill {
        align-self: flex-start;
        background: transparent !important;
    }
    .ngsq-modal__close { background: rgba(255,255,255,0.14) !important; border-color: rgba(255,255,255,0.28) !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .ngsq { --ngsq-w: 30.5vw; --ngsq-h: 320px; }
    .ngsq-cta__line2 { font-size: 25px; }
}
@media (max-width: 720px) {
    .ngsq { --ngsq-w: 45vw; --ngsq-h: 268px; }
    .ngsq__stdtitle { font-size: 18px !important; }
    .ngsq-card__text h3 { font-size: 13.5px !important; }
    .ngsq-card__text p { font-size: 11px !important; }
    .ngsq-cta__line2 { font-size: 21px; }
    .ngsq-cta { padding: 20px 16px; }
    .ngsq-more { width: 36px; height: 36px; right: 8px; bottom: 10px; }
    .ngsq-modal__body-inner { padding-left: 16px; padding-right: 16px; }
    .ngsq-modal__body h3 { font-size: 18px !important; }
    .ngsq-modal__body p { font-size: 13px !important; margin-bottom: 14px !important; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .ngsq__track.is-marquee,
    .ngsq-cta__blob,
    .ngsq-more { animation: none !important; }
    .ngsq-card .ngsq-card__media,
    .ngsq-cta__bg { transition: none !important; }
}
