/* ==========================================================================
   THUNDER HOST — VISITOR (GUEST) THEME — BASE TOKENS & HEADER
   ========================================================================== */

:root {
    --th-primary:        #059669;
    --th-primary-dark:   #047857;
    --th-primary-light:  #10B981;
    --th-accent:         #D97706;
    --th-accent-light:   #F59E0B;
    --th-ink:            #0F172A;
    --th-ink-soft:       #1E293B;
    --th-muted:          #64748B;
    --th-border:         rgba(15, 23, 42, .08);
    --th-surface:        #FFFFFF;
    --th-soft:           #F8FAFC;
    --th-soft-2:         #F1F5F9;
    --th-success:        #10B981;
    --th-warning:        #D97706;
    --th-danger:         #DC2626;
    --th-info:           #0EA5E9;
    --th-radius:         16px;
    --th-radius-sm:      10px;
    --th-radius-lg:      24px;
    --th-shadow:         0 4px 6px -1px rgba(15, 23, 42, .06), 0 2px 4px -2px rgba(15, 23, 42, .04);
    --th-shadow-lg:      0 20px 40px -10px rgba(15, 23, 42, .12), 0 8px 16px -4px rgba(15, 23, 42, .06);
}

:root {
    --bs-primary:        #059669;
    --bs-primary-rgb:    5, 150, 105;
    --bs-secondary:      #0F172A;
    --bs-secondary-rgb:  15, 23, 42;
    --bs-success:        #10B981;
    --bs-success-rgb:    16, 185, 129;
    --bs-warning:        #D97706;
    --bs-warning-rgb:    217, 119, 6;
    --bs-info:           #0EA5E9;
    --bs-info-rgb:       14, 165, 233;
    --bs-danger:         #DC2626;
    --bs-danger-rgb:     220, 38, 38;
    --bs-body-bg:        #FFFFFF;
    --bs-body-color:     #0F172A;
    --bs-border-color:   rgba(15, 23, 42, .08);
    --bs-link-color:     #047857;
    --bs-link-hover-color: #059669;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
}

*, *::before, *::after { box-sizing: border-box; }

svg:not(:root):not([width]):not([height]) {
    overflow: hidden;
    display: block;
    width: 0;
    height: 0;
}

/* SVG icons used in UI elements must override the above */
.th-header svg.icon,
.th-mobile-toggle svg.icon,
.th-mobile-drawer svg.icon,
.th-topbar svg.icon,
.th-nav-link svg.icon,
.th-dropdown-icon svg.icon,
.th-btn svg.icon,
.th-client-nav svg.icon,
.th-client-topbar svg.icon,
.th-client-icon-btn svg.icon,
.th-client-mobile-toggle svg.icon {
    display: inline-block !important;
    overflow: visible !important;
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0;
}

body.th-visitor-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--th-ink);
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

.th-visitor-body h1, .th-visitor-body h2, .th-visitor-body h3, .th-visitor-body h4, .th-visitor-body h5 {
    font-weight: 800;
    letter-spacing: -.025em;
    color: var(--th-ink);
    line-height: 1.2;
}

.th-visitor-body a { text-decoration: none; }
.th-visitor-body img { max-width: 100%; height: auto; }

.th-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Top bar */
.th-topbar {
    background: var(--th-ink);
    color: #cbd5e1;
    font-size: .82rem;
    padding: .55rem 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.th-topbar a { color: #cbd5e1; }
.th-topbar a:hover { color: #fff; }
.th-topbar .th-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.th-topbar-left, .th-topbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.th-topbar-right svg.icon { width: 16px; height: 16px; vertical-align: -3px; }
.th-cart-link svg.icon { width: 21px; height: 21px; }
@media (max-width: 768px) {
    .th-topbar-left .hide-mobile { display: none; }
}

/* Header / Nav */
.th-header {
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--th-border);
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: all .2s ease;
}
.th-header.scrolled {
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 2px 12px rgba(15, 23, 42, .06);
}

.th-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 72px;
    min-width: 0;
    overflow: visible;
}

.th-brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-weight: 900;
    font-size: 1.25rem;
    letter-spacing: -.04em;
    color: var(--th-ink) !important;
    min-width: 0;
    flex: 0 0 auto;
    white-space: nowrap;
}
.th-brand > span:last-child { min-width: 0; white-space: nowrap; }
.th-brand img {
    display: block;
    width: auto;
    height: 38px;
    max-width: min(140px, 24vw);
    flex: 0 1 auto;
    object-fit: contain;
    background: transparent;
    mix-blend-mode: multiply;
}
.th-client-brand img { max-height: 28px; width: auto; height: auto; object-fit: contain; }
.th-footer-brand img { max-height: 40px; width: auto; height: auto; object-fit: contain; }
.th-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--th-primary), var(--th-primary-dark));
    color: #fff;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(5, 150, 105, .25);
}

.th-nav {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}
.th-nav-item { position: relative; }
.th-nav-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--th-ink);
    font-weight: 600;
    font-size: .94rem;
    padding: .55rem .9rem;
    border-radius: var(--th-radius-sm);
    transition: all .2s ease;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.th-nav-link:hover, .th-nav-link.active {
    color: var(--th-primary);
    background: rgba(5, 150, 105, .07);
}
.th-nav-link svg { width: 16px; height: 16px; }

.th-dropdown { position: relative; }
.th-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 300px;
    background: #fff;
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius);
    box-shadow: var(--th-shadow-lg);
    padding: .5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all .2s ease;
    z-index: 100;
    list-style: none;
}
.th-dropdown:hover > .th-dropdown-menu,
.th-dropdown:focus-within > .th-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.th-dropdown-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .85rem;
    border-radius: var(--th-radius-sm);
    color: var(--th-ink);
    font-size: .9rem;
    transition: all .15s ease;
}
.th-dropdown-item:hover {
    background: rgba(5, 150, 105, .06);
    color: var(--th-primary);
}
.th-dropdown-icon {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(5, 150, 105, .1);
    color: var(--th-primary);
    border-radius: 8px;
    flex-shrink: 0;
}
.th-dropdown-icon svg { width: 18px; height: 18px; }
.th-dropdown-item strong { display: block; color: var(--th-ink); font-size: .92rem; }
.th-dropdown-item small { color: var(--th-muted); font-size: .78rem; }

.th-nav-cta {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 0 0 auto;
}

/* Mobile toggle */
.th-mobile-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: .5rem;
    color: var(--th-ink);
    font-size: 1.4rem;
    cursor: pointer;
    flex: 0 0 auto;
    line-height: 1;
}
.th-mobile-toggle svg.icon {
    display: inline-block !important;
    width: 26px !important;
    height: 26px !important;
    overflow: visible !important;
    vertical-align: middle;
}

@media (max-width: 991.98px) {
    .th-nav, .th-nav-cta-desktop { display: none !important; }
    .th-mobile-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        color: var(--th-ink) !important;
        background: var(--th-soft-2) !important;
        border: 1px solid var(--th-border);
        border-radius: var(--th-radius-sm);
    }
    .th-mobile-toggle svg.icon {
        display: block !important;
        width: 24px !important;
        height: 24px !important;
        overflow: visible !important;
        flex-shrink: 0;
    }
    .th-navbar { gap: .75rem; }
    .th-brand { max-width: none; }
    .th-brand img { max-width: 120px; }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .th-navbar { gap: .5rem; }
    .th-nav { gap: 0; }
    .th-nav-link { padding-left: .45rem; padding-right: .45rem; font-size: .88rem; }
    .th-nav-cta { gap: .3rem; }
    .th-btn { padding-left: .75rem; padding-right: .75rem; font-size: .85rem; }
    .th-brand { font-size: 1.1rem; }
    .th-brand img { max-width: 110px; }
}

@media (max-width: 575.98px) {
    .th-container { padding-left: 1rem; padding-right: 1rem; }
    .th-topbar-inner { gap: .5rem; }
    .th-topbar-left, .th-topbar-right { gap: .65rem; }
    .th-topbar-right { justify-content: flex-end; }
    .th-brand { font-size: 1.15rem; }
    .th-brand img { max-width: 105px; }
}

.th-mobile-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(360px, 100%);
    background: #fff;
    z-index: 1050;
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform .25s ease;
    overflow-y: auto;
    box-shadow: -10px 0 40px rgba(15, 23, 42, .12);
}
.th-mobile-drawer.open { transform: translateX(0); }
.th-mobile-drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 1045;
    opacity: 0;
    visibility: hidden;
    transition: all .2s ease;
}
.th-mobile-drawer-overlay.open { opacity: 1; visibility: visible; }
.th-mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--th-border);
}
.th-mobile-drawer-close {
    background: transparent;
    border: 0;
    color: var(--th-ink);
    cursor: pointer;
    padding: .25rem;
}
.th-mobile-drawer-nav { display: flex; flex-direction: column; gap: .25rem; }
.th-mobile-drawer-nav .th-nav-link {
    padding: .85rem 1rem;
    font-size: 1rem;
    border-radius: var(--th-radius-sm);
    width: 100%;
    justify-content: flex-start;
}
.th-mobile-drawer-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--th-border);
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
