/* ── main.css — shared styles for all NovMac pages ── */

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

/* ── Design tokens ── */
:root {
    --bg: #000; --surface: #111; --surface2: #1a1a1a; --border: #2a2a2a;
    --text: #f5f5f7; --muted: #86868b; --accent: #0071e3; --accent-hover: #0077ed;
    --red: #ff3b30;
}
[data-theme="light"] {
    --bg: #f5f5f7; --surface: #fff; --surface2: #f0f0f0; --border: #d2d2d7;
    --text: #1d1d1f; --muted: #515154;
}

/* ── Base ── */
body {
    background: var(--bg); color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%; overscroll-behavior-y: auto;
}
a { text-decoration: none; color: inherit; }

/* ── Skip link (accessibility) ── */
.skip-link {
    position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
    z-index: 999; background: var(--accent); color: #fff; font-size: 0.9rem; font-weight: 600;
    padding: 0.75rem 1.5rem; border-radius: 0 0 12px 12px; text-decoration: none;
}
.skip-link:focus {
    position: fixed; left: 50%; top: 0; transform: translateX(-50%);
    width: auto; height: auto; overflow: visible;
}

/* ── Announcement bar ── */
.announce-bar {
    background: var(--accent); color: #fff; text-align: center;
    font-size: 0.8rem; font-weight: 500; letter-spacing: 0.02em; padding: 0.5rem 2.5rem 0.5rem 1rem;
    position: relative;
}
.announce-close {
    position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #fff; font-size: 1.1rem; cursor: pointer;
    opacity: 0.7; line-height: 1; padding: 0.2rem 0.4rem;
}
.announce-close:hover { opacity: 1; }

/* ── Theme toggle ── */
.theme-toggle {
    background: none; border: 1px solid var(--border); border-radius: 980px;
    color: var(--muted); cursor: pointer; font-size: 0.78rem; padding: 0.3rem 0.8rem;
    transition: color 0.15s, border-color 0.15s; font-family: inherit;
}
.theme-toggle:hover { color: var(--text); border-color: #888; }

/* ── Sticky header wrapper ── */
.sticky-header { position: sticky; top: 0; z-index: 100; }

/* ── Top bar ── */
.topbar {
    background: rgba(0,0,0,0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; height: 52px;
}
[data-theme="light"] .topbar { background: rgba(245,245,247,0.85); }
.topbar-logo img { height: 28px; width: auto; display: block; }
.topbar-links { display: flex; gap: 1.5rem; font-size: 0.78rem; color: var(--muted); }
.topbar-links a:hover { color: var(--text); }
.topbar-links a.active { color: var(--text); }
.topbar-cta { font-size: 0.78rem; color: var(--accent); font-weight: 500; }
.topbar-cta:hover { color: var(--accent-hover); }

/* ── Nav dropdown (Products mega-menu) ── */
.nav-dropdown { position: static; }
.nav-arrow {
    display: inline-block; margin-left: 0.15rem; width: 6px; height: 4px;
    vertical-align: middle; transition: transform 0.2s; opacity: 0.35;
}
.nav-dropdown.open .nav-arrow { transform: rotate(180deg); opacity: 0.6; }
.nav-mega {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 110;
    background: var(--surface);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.nav-mega.open { display: block; }
.nav-mega-inner {
    max-width: 1100px; margin: 0 auto;
    padding: 1.75rem 2rem 2rem;
}
.mega-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    padding-bottom: 1.5rem; margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.mega-grid:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.mega-col {
    padding: 0 1.75rem; border-left: 1px solid var(--border);
}
.mega-col:first-child { border-left: none; padding-left: 0; }
.mega-col h4 {
    font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 0.65rem;
}
.mega-col a {
    display: block; font-size: 0.82rem; color: var(--muted); padding: 0.22rem 0;
    transition: color 0.15s;
}
.mega-col a:hover { color: var(--text); }
.mega-all { color: var(--accent) !important; font-weight: 600; margin-top: 0.5rem; }
.mega-all:hover { color: var(--accent-hover) !important; }

/* Mega-menu close button */
.mega-close {
    position: fixed; top: 1rem; right: 1.5rem; z-index: 111;
    background: none; border: 1px solid var(--border); border-radius: 50%;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: var(--muted); cursor: pointer; line-height: 1;
    transition: color 0.15s, border-color 0.15s;
}
.mega-close:hover { color: var(--text); border-color: var(--muted); }

/* Tablet/phone: mega-menu adjustments */
@media (max-width: 1024px) {
    .nav-mega-inner { padding: 1.25rem 1rem 5rem; }
    .mega-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem 0; }
    .mega-col { border-left: none; padding: 0 0.75rem; }
    .mega-col:first-child { padding-left: 0; }
    .mega-col:nth-child(odd) { border-left: none; }
    .mega-col:nth-child(even) { border-left: 1px solid var(--border); }
}
@media (max-width: 480px) {
    .mega-grid { grid-template-columns: 1fr; }
    .mega-col { padding: 0 !important; border-left: none !important; }
}

@media (max-width: 600px) {
    .topbar-links { display: none; }
    .topbar { padding: 0 max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
}
@media (min-width: 1400px) {
    .topbar { padding-left: max(2rem, calc((100% - 1400px) / 2 + 2rem)); padding-right: max(2rem, calc((100% - 1400px) / 2 + 2rem)); }
    .nav-mega { padding-left: max(2rem, calc((100% - 1400px) / 2 + 2rem)); padding-right: max(2rem, calc((100% - 1400px) / 2 + 2rem)); }
}

/* ── Footer ── */
footer { background: var(--surface); border-top: 1px solid var(--border); padding: 3rem 1.5rem max(2rem, env(safe-area-inset-bottom)); }
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 2rem; margin-bottom: 2.5rem; }
.footer-col h4 { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); margin-bottom: 0.9rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a { font-size: 0.8rem; color: var(--muted); transition: color 0.15s; }
.footer-col ul li a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; font-size: 0.75rem; color: var(--muted); }
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--text); }
.footer-bottom-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }

/* ── Bottom nav — shared item styles ── */
.bn-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.25rem; color: var(--muted); font-size: 0.62rem; font-weight: 500;
    letter-spacing: 0.02em; text-decoration: none; border-radius: 14px;
    transition: color 0.15s, background 0.15s, transform 0.15s;
    cursor: pointer; background: none; border: none; font-family: inherit;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.bn-item:active { transform: scale(0.92); }
.bn-item:hover, .bn-item.active { color: var(--text); }
.bn-item svg { width: 24px; height: 24px; flex-shrink: 0; }
.bn-cta {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.25rem; background: var(--accent); color: #fff !important; border-radius: 18px;
    font-size: 0.62rem; font-weight: 600; letter-spacing: 0.04em; text-decoration: none;
    box-shadow: 0 4px 24px rgba(0,113,227,0.45); transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.bn-cta:hover { background: var(--accent-hover); box-shadow: 0 6px 28px rgba(0,113,227,0.6); }
.bn-cta svg { width: 22px; height: 22px; }

/* ── Bottom nav dropdown (Products submenu in bottom nav) ── */
.bn-dropdown { position: relative; display: contents; }
.bn-icon-wrap { display: inline-flex; align-items: center; gap: 0.1rem; justify-content: center; }
.bn-icon-wrap > svg:last-child { width: 24px; height: 24px; }
.bn-arrow { width: 3px; height: 5px; flex-shrink: 0; transition: transform 0.2s; opacity: 0.25; }
.bn-dropdown.open .bn-arrow { transform: rotate(180deg); opacity: 0.5; }
.bn-submenu {
    display: none; position: absolute; z-index: 210;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
[data-theme="light"] .bn-submenu { box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.bn-dropdown.open .bn-submenu { display: flex; }
.bn-submenu a {
    font-size: 0.78rem; color: var(--muted); padding: 0.45rem 0.8rem; border-radius: 8px;
    transition: background 0.15s, color 0.15s; white-space: nowrap; text-decoration: none;
}
.bn-submenu a:hover { background: var(--surface2); color: var(--text); }
.bn-submenu a.sub-all { color: var(--accent); font-weight: 500; }
.bn-submenu a.sub-all:hover { color: var(--accent-hover); }

/* ── Bottom nav — mobile/tablet: horizontal bar ── */
.bottom-nav { display: none; }
@media (max-width: 1024px) {
    .bottom-nav {
        display: flex; flex-direction: row; position: fixed; bottom: 0; left: 0; right: 0;
        z-index: 200; align-items: flex-end; justify-content: space-around;
        background: rgba(10,10,10,0.75); backdrop-filter: blur(28px) saturate(180%);
        -webkit-backdrop-filter: blur(28px) saturate(180%);
        border-top: 1px solid rgba(255,255,255,0.07);
        padding: 0.5rem 0.5rem max(0.75rem, env(safe-area-inset-bottom)); gap: 0.25rem;
    }
    [data-theme="light"] .bottom-nav { background: rgba(245,245,247,0.82); border-top: 1px solid rgba(0,0,0,0.08); }
    footer { padding-bottom: calc(max(2rem, env(safe-area-inset-bottom)) + 72px); }
    .bn-item { flex: 1; padding: 0.5rem 0.25rem; }
    .bn-cta { flex: 0 0 auto; padding: 0.65rem 1.1rem 0.5rem; margin-bottom: 0.25rem; transform: translateY(-8px); }
    .bn-cta:active { transform: translateY(-8px) scale(0.94); }
    .bn-dropdown { display: flex; flex: 1; position: static; }
    .bn-submenu {
        position: fixed; bottom: calc(env(safe-area-inset-bottom, 0px) + 64px); left: 0.5rem; right: 0.5rem;
        flex-direction: row; flex-wrap: wrap; justify-content: center;
        padding: 0.6rem 0.5rem; gap: 0.3rem; border-radius: 14px;
    }
    .bn-submenu a { flex: 0 0 auto; }
    .bn-submenu a.sub-all { border-left: 1px solid var(--border); margin-left: 0.15rem; padding-left: 0.75rem; }
}

/* ── Bottom nav — desktop: vertical floating pill ── */
@media (min-width: 1025px) {
    .bottom-nav {
        display: flex; flex-direction: column; position: fixed; right: 1.5rem; top: 50%;
        transform: translateY(-50%); z-index: 200; align-items: center; justify-content: center;
        gap: 0.15rem; background: rgba(10,10,10,0.72); backdrop-filter: blur(28px) saturate(180%);
        -webkit-backdrop-filter: blur(28px) saturate(180%); border: 1px solid rgba(255,255,255,0.08);
        border-radius: 28px; padding: 0.75rem 0.5rem;
    }
    [data-theme="light"] .bottom-nav { background: rgba(245,245,247,0.85); border: 1px solid rgba(0,0,0,0.08); }
    .bn-item { flex: 0 0 auto; padding: 0.6rem 0.75rem; font-size: 0.6rem; border-radius: 16px; min-width: 56px; }
    .bn-item:hover { background: rgba(255,255,255,0.07); color: var(--text); }
    [data-theme="light"] .bn-item:hover { background: rgba(0,0,0,0.05); }
    .bn-cta { flex: 0 0 auto; padding: 0.7rem 0.75rem 0.6rem; border-radius: 18px; margin: 0.3rem 0; min-width: 56px; font-size: 0.6rem; }
    .bn-cta:active { transform: scale(0.94); }
    .bn-dropdown { display: flex; flex-direction: column; align-items: center; }
    .bn-submenu {
        bottom: calc(100% + 0.5rem); right: calc(100% + 0.5rem); left: auto;
        flex-direction: column; padding: 0.5rem; min-width: 150px; border-radius: 14px;
    }
    .bn-submenu a.sub-all { margin-top: 0.25rem; padding-top: 0.5rem; border-top: 1px solid var(--border); border-left: none; margin-left: 0; }
}

/* ── Shared inner-page components ── */

/* Page hero */
.page-hero { padding: 7rem 2rem 5rem; text-align: center; max-width: 820px; margin: 0 auto; }
.page-eyebrow { display: block; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.5rem; }
.page-hero h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.08; margin-bottom: 1.5rem; }
.page-hero .lead { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--muted); line-height: 1.75; max-width: 600px; margin: 0 auto; }

/* CTA section */
.cta-section { background: var(--surface); border-top: 1px solid var(--border); padding: 6rem 2rem; text-align: center; }
.cta-section h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -0.03em; margin-bottom: 1rem; }
.cta-section p { font-size: 1rem; color: var(--muted); margin-bottom: 2.5rem; max-width: 480px; margin-left: auto; margin-right: auto; }
.btn-group { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-primary { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--accent); color: #fff; font-size: 0.95rem; font-weight: 600; padding: 0.85rem 2rem; border-radius: 980px; transition: background 0.15s, transform 0.15s; }
.btn-primary:hover { background: var(--accent-hover); transform: scale(1.02); }
.btn-outline { display: inline-flex; align-items: center; gap: 0.5rem; border: 1px solid var(--border); color: var(--text); font-size: 0.95rem; font-weight: 500; padding: 0.85rem 2rem; border-radius: 980px; transition: border-color 0.15s, transform 0.15s; }
.btn-outline:hover { border-color: var(--text); transform: scale(1.02); }
