/* ─────────────────────────────────────────────────────────────────────────────
   NextGen Trade Portal — portal.css v2.4.0
   Mobile-first · Montserrat · Light default · Dark toggle · Cinematic cards
───────────────────────────────────────────────────────────────────────────── */

/* ── Light mode (default) custom properties ────────────────────────────────── */
.ng-portal {
    --brand:      #00b5bd;
    --brand-dk:   #008a91;
    --brand-lt:   #33c9d0;
    --bg:         #ffffff;
    --bg-card:    #f5f5f5;
    --bg-card2:   #ebebeb;
    --bg-input:   #ffffff;
    --bg-blank:   linear-gradient(135deg, #e2e2e2, #ebebeb);
    --border:     rgba(0,0,0,0.09);
    --border-h:   rgba(0,181,189,0.50);
    --text:       #1a1a1a;
    --text-h:     #111111;
    --muted:      #777788;
    --bar-bg:     #f8f8f8;
    --bar-border: rgba(0,181,189,0.18);
    --radius:     8px;
    --ease:       cubic-bezier(0.22, 1, 0.36, 1);
    --gap:        clamp(12px, 3vw, 24px);
    --section-py: clamp(20px, 4vw, 48px);
}

/* ── Dark mode overrides ────────────────────────────────────────────────────── */
.ng-portal.is-dark {
    --bg:         #000000;
    --bg-card:    #0d0d0d;
    --bg-card2:   #161616;
    --bg-input:   #0d0d0d;
    --bg-blank:   linear-gradient(135deg, #111111, #0d0d0d);
    --border:     rgba(255,255,255,0.07);
    --border-h:   rgba(0,181,189,0.60);
    --text:       #d8d8e0;
    --text-h:     #ffffff;
    --muted:      #6a6a80;
    --bar-bg:     #030303;
    --bar-border: rgba(0,181,189,0.22);
}

/* ── Reset scope ───────────────────────────────────────────────────────────── */
.ng-portal *,
.ng-portal *::before,
.ng-portal *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ng-portal {
    background: var(--bg);
    color: var(--text);
    font-family: Montserrat, sans-serif;
    font-size: clamp(0.875rem, 2vw, 1rem);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Ambient glow ──────────────────────────────────────────────────────────── */
#ng-glow {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(
        700px circle at var(--mx, 50%) var(--my, 30%),
        rgba(0,181,189,0.06) 0%,
        transparent 65%
    );
    transition: background 0.08s linear;
}

.ng-portal.is-dark #ng-glow {
    background: radial-gradient(
        800px circle at var(--mx, 50%) var(--my, 30%),
        rgba(0,181,189,0.12) 0%,
        transparent 65%
    );
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.ng-hero {
    position: relative;
    min-height: clamp(200px, 38vw, 400px);
    display: flex;
    align-items: flex-end;
    padding: clamp(20px, 4vw, 52px);
    background: var(--hero-bg) center/cover no-repeat;
    z-index: 1;
    border-radius: var(--radius);
    margin: var(--gap) var(--gap) 0;
    overflow: hidden;
}

.ng-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0,0,0,0.82) 0%,
        rgba(0,0,0,0.52) 50%,
        rgba(0,0,0,0.25) 100%
    );
}

.ng-hero-content {
    position: relative;
    z-index: 1;
    max-width: 580px;
    background: rgba(0,0,0,0.42);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: clamp(16px, 3vw, 28px);
}

.ng-hero-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 8px;
}

/* Hero title always white — it sits on a photo with dark overlay */
.ng-hero-title {
    font-size: clamp(1.6rem, 4.5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 12px;
}

.ng-hero-sub {
    font-size: clamp(0.85rem, 1.8vw, 1.05rem);
    color: rgba(255,255,255,0.68);
    max-width: 460px;
}

/* ── Section wrapper ───────────────────────────────────────────────────────── */
.ng-section {
    position: relative;
    z-index: 1;
    padding: var(--section-py) var(--gap);
}

.ng-portal > .ng-section:first-of-type { padding-top: clamp(14px, 2.5vw, 22px); }

.ng-section + .ng-section { border-top: 1px solid var(--border); }

/* ── Section header ────────────────────────────────────────────────────────── */
.ng-section-head { margin-bottom: clamp(14px, 2.5vw, 28px); }

.ng-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.ng-eyebrow-num {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}

.ng-eyebrow-rule {
    flex: 0 0 26px;
    height: 1px;
    background: var(--brand);
    opacity: 0.45;
}

.ng-eyebrow-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.ng-section-head h2,
.ng-section-title {
    font-size: clamp(1.3rem, 3.2vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--text-h);
    margin-bottom: 6px;
}

.ng-section-sub {
    font-size: clamp(0.78rem, 1.5vw, 0.875rem);
    color: var(--muted);
    max-width: 520px;
}

/* ── Filter bar ────────────────────────────────────────────────────────────── */
.ng-filter-bar { margin-bottom: clamp(14px, 2.5vw, 22px); }

.ng-filter-bar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* Action buttons group (search + theme toggle) */
.ng-bar-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

/* ── Category pills ────────────────────────────────────────────────────────── */
.ng-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.ng-pill {
    font-family: Montserrat, sans-serif;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 13px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    white-space: nowrap;
}

.ng-pill:hover { border-color: rgba(0,181,189,0.45); color: var(--brand); }

.ng-pill.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #000;
}

/* ── Icon buttons (search toggle + theme toggle) ───────────────────────────── */
.ng-search-toggle,
.ng-theme-toggle {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    padding: 0;
}

.ng-search-toggle:hover,
.ng-search-toggle[aria-expanded="true"],
.ng-theme-toggle:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: rgba(0,181,189,0.08);
}

.ng-search-toggle svg,
.ng-theme-toggle svg { width: 15px; height: 15px; }

/* Theme icon visibility — CSS controls which icon shows */
.ng-theme-toggle .ng-icon-sun  { display: none; }
.ng-theme-toggle .ng-icon-moon { display: flex; }

.ng-portal.is-dark .ng-theme-toggle .ng-icon-sun  { display: flex; }
.ng-portal.is-dark .ng-theme-toggle .ng-icon-moon { display: none; }

/* ── Search drawer — grid-rows trick for smooth open AND close ─────────────── */
.ng-search-drawer {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    margin-top: 0;
    transition:
        grid-template-rows 0.38s var(--ease),
        opacity            0.28s ease,
        margin-top         0.32s var(--ease);
}

.ng-search-drawer.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 10px;
}

/* Inner wrapper must have overflow:hidden for the grid trick */
.ng-search-drawer > .ng-search-wrap {
    overflow: hidden;
    padding-bottom: 3px; /* prevents bottom clipping */
}

/* ── Search input ──────────────────────────────────────────────────────────── */
.ng-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ng-search-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--muted);
    pointer-events: none;
    flex-shrink: 0;
    z-index: 1;
}

.ng-search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: 24px;       /* Rounded pill */
    padding: 11px 42px;        /* Symmetric padding so centered text clears icons */
    font-family: Montserrat, sans-serif;
    font-size: 1rem;           /* Larger font */
    font-weight: 500;
    color: var(--text);
    text-align: center;        /* Centered text */
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    -webkit-appearance: none;
}

/* Kill all native browser search UI chrome */
.ng-search-input::-webkit-search-cancel-button,
.ng-search-input::-webkit-search-decoration,
.ng-search-input::-webkit-search-results-button,
.ng-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none;
}

.ng-search-input::placeholder {
    color: var(--muted);
    text-align: center;
}

.ng-search-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0,181,189,0.12);
}

.ng-search-clear {
    position: absolute;
    right: 14px;
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 2px 4px;
    transition: color 0.2s;
    z-index: 1;
}

.ng-search-clear:hover { color: var(--text); }

/* Empty state */
.ng-no-results {
    grid-column: 1 / -1;
    padding: clamp(28px, 5vw, 56px) 0;
    text-align: center;
    color: var(--muted);
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
}

/* ── Card grid — 2 col mobile-first ───────────────────────────────────────── */
.ng-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
}

@media (min-width: 900px)  { .ng-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .ng-grid { grid-template-columns: repeat(4, 1fr); } }

/* ── Card ──────────────────────────────────────────────────────────────────── */
.ng-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease),
                transform 0.4s var(--ease), background 0.3s ease;
    position: relative;
    will-change: transform;
}

/* Shine sweep pseudo-element */
.ng-card::after {
    content: '';
    position: absolute;
    top: -110%; left: -210%;
    width: 200%; height: 200%;
    background: linear-gradient(
        rgba(255,255,255,0)   0%,
        rgba(255,255,255,0.05) 50%,
        rgba(255,255,255,0)   100%
    );
    transform: rotate(30deg);
    transition: top 0.65s ease, left 0.65s ease;
    pointer-events: none;
    z-index: 3;
}

.ng-card:hover::after,
.ng-card:focus-visible::after { top: 110%; left: 110%; }

.ng-card:hover,
.ng-card:focus-visible {
    transform: scale(1.04) translateY(-7px);
    border-color: var(--border-h);
    box-shadow: 0 0 0 1px var(--border-h), 0 16px 40px rgba(0,0,0,0.18);
    outline: none;
    z-index: 2;
}

.ng-portal.is-dark .ng-card:hover,
.ng-portal.is-dark .ng-card:focus-visible {
    box-shadow: 0 0 0 1px var(--border-h), 0 28px 60px rgba(0,0,0,0.85);
}

.ng-card-img {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-card2);
    flex-shrink: 0;
    position: relative;
}

.ng-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--ease);
}

/* Subtle inner zoom — card itself already scales, so keep this light */
.ng-card:hover .ng-card-img img,
.ng-card:focus-visible .ng-card-img img { transform: scale(1.06); }

.ng-card-img-blank {
    width: 100%;
    height: 100%;
    background: var(--bg-blank);
}

/* ── Catalog cards — taller portrait image with gradient bleed ─────────────── */
[data-post-type="ng_catalog"] .ng-card-img {
    aspect-ratio: 3 / 4;
}

/* Bottom gradient bleeds from image into card body for seamless feel */
[data-post-type="ng_catalog"] .ng-card-img::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 38%;
    background: linear-gradient(to top, var(--bg-card) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
    transition: background 0.3s ease;
}

/* Dark mode: gradient from dark card bg */
.ng-portal.is-dark [data-post-type="ng_catalog"] .ng-card-img::after {
    background: linear-gradient(to top, #0f0f0f 0%, transparent 100%);
}

/* Card body */
.ng-card-body {
    padding: clamp(10px, 2vw, 18px);
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.ng-tag {
    display: inline-block;
    font-family: Montserrat, sans-serif;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand);
    background: rgba(0,181,189,0.09);
    border: 1px solid rgba(0,181,189,0.20);
    border-radius: 3px;
    padding: 2px 6px;
    align-self: flex-start;
}

.ng-card-title {
    font-size: clamp(0.8rem, 1.8vw, 0.98rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-h);
    letter-spacing: -0.01em;
}

.ng-card-desc {
    font-size: clamp(0.7rem, 1.4vw, 0.8rem);
    color: var(--muted);
    line-height: 1.5;
    flex: 1;
}

/* Specs list */
.ng-card-specs {
    list-style: none;
    padding: 0;
    margin: 2px 0 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ng-card-specs li {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--muted);
    padding-left: 12px;
    position: relative;
    line-height: 1.45;
}

.ng-card-specs li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--brand);
    font-size: 0.6rem;
    top: 1px;
}

.ng-cta {
    margin-top: auto;
    padding: 9px 14px;
    font-family: Montserrat, sans-serif;
    font-size: 0.63rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #000;
    background: var(--brand);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.25s var(--ease), gap 0.2s var(--ease);
    position: relative;
    z-index: 1;
}

.ng-card:hover .ng-cta,
.ng-card:focus-visible .ng-cta {
    background: var(--brand-lt);
    gap: 9px;
}

/* ── Badge ribbon ──────────────────────────────────────────────────────────── */
.ng-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-family: Montserrat, sans-serif;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: 20px;
    padding: 3px 8px;
    pointer-events: none;
    z-index: 2;
    line-height: 1.4;
}

.ng-badge--new     { background: #00b5bd; color: #000; }
.ng-badge--updated { background: #008a91; color: #fff; }

/* ── Resource grid ─────────────────────────────────────────────────────────── */
.ng-resource-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--gap) * 0.75);
}

@media (min-width: 640px)  { .ng-resource-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .ng-resource-grid { grid-template-columns: repeat(3, 1fr); } }

/* ── Resource card ─────────────────────────────────────────────────────────── */
.ng-resource {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: clamp(12px, 2vw, 20px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
                background 0.3s ease;
}

.ng-resource:hover,
.ng-resource:focus-visible {
    border-color: var(--border-h);
    background: var(--bg-card2);
    box-shadow: 0 0 0 1px var(--border-h), 0 6px 20px rgba(0,181,189,0.08);
    outline: none;
}

/* Dark mode: cinematic gradient cards */
.ng-portal.is-dark .ng-resource {
    background: linear-gradient(to bottom right, #1a1a1a, #000);
}

.ng-portal.is-dark .ng-resource:hover,
.ng-portal.is-dark .ng-resource:focus-visible {
    background: linear-gradient(to bottom right, #1e1e1e, #0a0a0a);
}

.ng-resource-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.ng-resource-title {
    font-size: clamp(0.82rem, 1.6vw, 0.92rem);
    font-weight: 700;
    color: var(--text-h);
    line-height: 1.3;
}

.ng-resource-desc {
    font-size: clamp(0.7rem, 1.3vw, 0.8rem);
    color: var(--muted);
    line-height: 1.5;
}

.ng-resource-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--brand);
    transition: border-color 0.3s, transform 0.3s var(--ease);
}

.ng-resource:hover .ng-resource-icon,
.ng-resource:focus-visible .ng-resource-icon {
    border-color: var(--brand);
    background: var(--brand);
    color: #000;
    transform: translateX(3px);
}

.ng-resource-icon svg { width: 15px; height: 15px; }

/* ── Scroll-reveal — blur + scale + rise (cinematic entry) ─────────────────── */
.ng-reveal {
    opacity: 0;
    transform: scale(0.94) translateY(14px);
    filter: blur(6px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), filter 0.55s var(--ease);
}

.ng-reveal.is-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
}

.ng-grid .ng-reveal:nth-child(1),
.ng-resource-grid .ng-reveal:nth-child(1) { transition-delay: 0.04s; }
.ng-grid .ng-reveal:nth-child(2),
.ng-resource-grid .ng-reveal:nth-child(2) { transition-delay: 0.08s; }
.ng-grid .ng-reveal:nth-child(3),
.ng-resource-grid .ng-reveal:nth-child(3) { transition-delay: 0.12s; }
.ng-grid .ng-reveal:nth-child(4),
.ng-resource-grid .ng-reveal:nth-child(4) { transition-delay: 0.16s; }
.ng-grid .ng-reveal:nth-child(5)          { transition-delay: 0.20s; }
.ng-grid .ng-reveal:nth-child(6)          { transition-delay: 0.24s; }
.ng-grid .ng-reveal:nth-child(n+7)        { transition-delay: 0.28s; }

@media (prefers-reduced-motion: reduce) {
    .ng-reveal { opacity: 1; transform: none; filter: none; transition: none; }
    .ng-card   { transform: none !important; transition: none; }
    .ng-card::after { display: none; }
    .ng-card-img img { transition: none; }
    .ng-resource-icon { transition: none; }
    .ng-search-drawer { transition: none; }
    .ng-portal { transition: none; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   NextGen Pro CTA — Desktop inline section (hidden on mobile)
───────────────────────────────────────────────────────────────────────────── */
/* ── Pro section — hidden on mobile (bar handles it there) ─────────────────── */
@media (max-width: 767px) { .ng-pro-section { display: none; } }

.ng-pro-section { padding-left: 0; padding-right: 0; }

.ng-pro-wrap {
    display: grid;
    grid-template-columns: 380px 1fr;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

@media (min-width: 1100px) { .ng-pro-wrap { grid-template-columns: 460px 1fr; } }

.ng-pro-photo {
    position: relative;
    min-height: 400px;
    overflow: hidden;
    flex-shrink: 0;
}

.ng-pro-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s var(--ease);
}

.ng-pro-section:hover .ng-pro-photo img { transform: scale(1.04); }

.ng-pro-body {
    padding: clamp(28px, 5vw, 52px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-card);
    justify-content: center;
}

.ng-portal.is-dark .ng-pro-body {
    background: linear-gradient(135deg, #111111, #000000);
}

.ng-pro-title {
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--text-h);
}

.ng-pro-accent { color: var(--brand); }

.ng-pro-desc {
    font-size: clamp(0.82rem, 1.5vw, 0.96rem);
    color: var(--muted);
    line-height: 1.7;
    max-width: 460px;
}

.ng-pro-desc strong { color: var(--text); font-weight: 700; }

.ng-pro-fields { display: flex; flex-direction: column; gap: 10px; }

.ng-pro-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ng-pro-field { display: flex; flex-direction: column; gap: 4px; }

.ng-pro-field label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.ng-pro-field label span { color: var(--brand); }

.ng-pro-field input {
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 9px 13px;
    font-family: Montserrat, sans-serif;
    font-size: 0.875rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.ng-pro-field input::placeholder { color: var(--muted); opacity: 0.7; }

.ng-pro-field input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0,181,189,0.10);
}

.ng-pro-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.ng-pro-msg { flex: 1; font-size: 0.78rem; color: var(--muted); min-width: 0; }
.ng-pro-msg.is-success { color: #007a5e; }
.ng-pro-msg.is-error   { color: #cc3333; }
.ng-portal.is-dark .ng-pro-msg.is-success { color: #4fd8af; }
.ng-portal.is-dark .ng-pro-msg.is-error   { color: #ff6b6b; }

.ng-pro-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand);
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 12px 28px;
    font-family: Montserrat, sans-serif;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}

.ng-pro-submit:hover   { background: var(--brand-lt); }
.ng-pro-submit:active  { transform: scale(0.98); }
.ng-pro-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.ng-pro-submit-spinner {
    display: none;
    width: 13px; height: 13px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: ngt-spin 0.7s linear infinite;
}

.ng-pro-submit.is-loading .ng-pro-submit-spinner { display: block; }
.ng-pro-submit.is-loading .ng-pro-submit-label   { opacity: 0.55; }

/* Desktop pro photo — bottom gradient overlay */
.ng-pro-photo {
    position: relative;
}

.ng-pro-photo::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 55%;
    background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.18) 60%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Mobile Pro Bar — fixed bottom strip (hidden on desktop)
───────────────────────────────────────────────────────────────────────────── */
.ngt-bar {
    display: none; /* shown only on mobile via media query */
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9998;
    background: #050505;
    border-top: 1px solid rgba(0,181,189,0.25);
    box-shadow: 0 -6px 32px rgba(0,0,0,0.55);
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: Montserrat, sans-serif;
    -webkit-font-smoothing: antialiased;
}

@media (max-width: 767px) { .ngt-bar { display: block; } }

.ngt-bar.is-visible   { transform: translateY(0); }
.ngt-bar.is-dismissed { transform: translateY(100%); pointer-events: none; }

.ngt-bar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
}

/* Left: photo + text — this whole part is the click target */
.ngt-bar-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: Montserrat, sans-serif;
    text-align: left;
}

.ngt-bar-photo {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid rgba(0,181,189,0.20);
}

.ngt-bar-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ngt-bar-brand {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #00b5bd;
}

.ngt-bar-sub {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ngt-bar-apply-btn {
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #000;
    background: #00b5bd;
    border-radius: 4px;
    padding: 7px 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.ngt-bar-dismiss {
    flex-shrink: 0;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 50%;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    padding: 0;
    transition: color 0.2s, border-color 0.2s;
}

.ngt-bar-dismiss:hover { color: #fff; border-color: rgba(255,255,255,0.28); }
.ngt-bar-dismiss svg   { width: 11px; height: 11px; }

/* ─────────────────────────────────────────────────────────────────────────────
   Mobile Pro Modal — light bottom sheet
───────────────────────────────────────────────────────────────────────────── */
.ngt-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    font-family: Montserrat, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.ngt-modal.is-open {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.ngt-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    animation: ngt-fade-in 0.25s ease forwards;
}

@keyframes ngt-fade-in { from { opacity: 0; } to { opacity: 1; } }

.ngt-modal-sheet {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-top: 3px solid #00b5bd;
    border-radius: 18px 18px 0 0;
    max-height: 93vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    animation: ngt-slide-up 0.36s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes ngt-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* Prominent X — dark circle, sits over the photo at top-right */
.ngt-modal-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.55);
    border: 2px solid rgba(255,255,255,0.35);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    z-index: 10;
    transition: background 0.2s, transform 0.15s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ngt-modal-close:hover  { background: rgba(0,0,0,0.80); transform: scale(1.08); }
.ngt-modal-close:active { transform: scale(0.95); }
.ngt-modal-close svg    { width: 14px; height: 14px; }

/* Photo + gradient overlay */
.ngt-modal-photo {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.ngt-modal-photo img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    object-position: center 25%;
}

/* Bottom gradient: light black → darker black, blending into white sheet */
.ngt-modal-photo-gradient {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60%;
    background: linear-gradient(to top, #ffffff 0%, rgba(20,20,20,0.55) 50%, transparent 100%);
    pointer-events: none;
}

/* Content area */
.ngt-modal-content {
    padding: 16px 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ngt-modal-title {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    color: #0a0a0a;
    line-height: 1.15;
}

.ngt-modal-title span { color: #00b5bd; }

.ngt-modal-desc {
    font-size: 0.78rem;
    color: #1a1a2e;
    line-height: 1.65;
}

/* Field rows with labels */
.ngt-modal-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.ngt-modal-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ngt-modal-field label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #111111;
}

.ngt-modal-field label span { color: #00b5bd; }

.ngt-modal-field input {
    background: #f5f5f7;
    border: 1.5px solid rgba(0,0,0,0.10);
    border-radius: 7px;
    padding: 11px 13px;
    font-family: Montserrat, sans-serif;
    font-size: 0.875rem;
    color: #111111;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.ngt-modal-field input::placeholder { color: #aaaaaa; }

.ngt-modal-field input:focus {
    border-color: #00b5bd;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0,181,189,0.12);
}

.ngt-modal-msg {
    font-size: 0.75rem;
    min-height: 1em;
    color: #333344;
}

.ngt-modal-msg.is-success { color: #007a5e; }
.ngt-modal-msg.is-error   { color: #cc3333; }

.ngt-modal-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #00b5bd;
    color: #000000;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-family: Montserrat, sans-serif;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    margin-top: 4px;
}

.ngt-modal-submit:hover   { background: #008a91; }
.ngt-modal-submit:active  { transform: scale(0.98); }
.ngt-modal-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.ngt-modal-submit-spinner {
    display: none;
    width: 13px; height: 13px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: ngt-spin 0.7s linear infinite;
}

.ngt-modal-submit.is-loading .ngt-modal-submit-spinner { display: block; }
.ngt-modal-submit.is-loading .ngt-modal-submit-label   { opacity: 0.55; }

@keyframes ngt-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .ngt-bar       { transition: none; }
    .ngt-modal-sheet    { animation: none; }
    .ngt-modal-backdrop { animation: none; }
    .ng-pro-submit-spinner, .ngt-modal-submit-spinner { animation: none; }
}

/* ── AI Chat coexistence — always shift chat launcher above the pro bar ──────
   body.ngt-trade-page is added via PHP body_class filter on trade portal pages.
   This fires at page load — no JS timing dependency.
   On mobile widget.css sets #ngai-launcher { position:fixed; bottom:22px } so
   we must override #ngai-launcher directly (the widget div itself is bottom:0). */
@media (max-width: 767px) {
    body.ngt-trade-page #ngai-launcher {
        bottom: 90px !important;
        transition: bottom 0.45s cubic-bezier(0.22, 1, 0.36, 1) !important;
    }

    /* Drop back to normal position once the bar has been dismissed */
    body.ngt-trade-page.ngt-bar-dismissed #ngai-launcher {
        bottom: 22px !important;
    }
}
