/**
 * TitanCart — Storefront Header, Nav & Footer
 *
 * Loaded on all TitanCart pages.
 * Hides theme default header/footer and replaces with TitanCart nav.
 *
 * Version 2.0 — design-token aware. Uses var(--tct-*, fallback) syntax so
 * the file works both with the TitanCart theme active (dark/light tokens
 * defined in theme.css drive every color) and standalone (each var falls
 * back to its original hex, preserving today's behavior).
 */

/* ══════════════════════════════════════════════════════════════════════════════
   THEME OVERRIDE — hide default header/footer on TitanCart pages
   ══════════════════════════════════════════════════════════════════════════════ */
body.titancart-shop #header,
body.titancart-product #header,
body.titancart-cart #header,
body.titancart-checkout #header,
body.titancart-order-received #header,
body.titancart-account #header,
body.titancart-search #header {
    display: none !important;
}
body.titancart-shop #footer,
body.titancart-product #footer,
body.titancart-cart #footer,
body.titancart-checkout #footer,
body.titancart-order-received #footer,
body.titancart-account #footer,
body.titancart-search #footer {
    display: none !important;
}
/* Hide <hr> separators from classic themes */
body.titancart-shop #page > hr,
body.titancart-product #page > hr,
body.titancart-cart #page > hr,
body.titancart-checkout #page > hr,
body.titancart-order-received #page > hr,
body.titancart-account #page > hr,
body.titancart-search #page > hr {
    display: none !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   TOP BAR — always-inverse-of-page surface
   In light mode: dark bg + light text. In dark mode: light bg + dark text.
   --tct-bg-inverse and --tct-text-on-inverse flip together via theme tokens.
   ══════════════════════════════════════════════════════════════════════════════ */
.tc-site-header {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
}

.tc-topbar {
    background: var(--tct-bg-inverse, #111);
    color: rgba(255,255,255,0.8);
    font-size: 12px;
}
[data-theme="dark"] .tc-topbar {
    color: rgba(10,10,15,0.7);
}
.tc-topbar__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.tc-topbar__links {
    display: flex;
    gap: 20px;
}
.tc-topbar__links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.15s;
}
.tc-topbar__links a:hover {
    color: #fff;
}
[data-theme="dark"] .tc-topbar__links a {
    color: rgba(10,10,15,0.6);
}
[data-theme="dark"] .tc-topbar__links a:hover {
    color: var(--tct-text-on-inverse, #0A0A0F);
}
.tc-topbar__right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.tc-topbar__msg {
    color: rgba(255,255,255,0.65);
    font-size: 11px;
}
[data-theme="dark"] .tc-topbar__msg {
    color: rgba(10,10,15,0.55);
}

/* ══════════════════════════════════════════════════════════════════════════════
   MAIN NAV
   ══════════════════════════════════════════════════════════════════════════════ */
.tc-nav {
    background: var(--tct-bg-elevated, #fff);
    border-bottom: 1px solid var(--tct-border, #e5e5e5);
    position: sticky;
    top: 0;
    z-index: 999;
}
/* WP admin bar offset */
body.admin-bar .tc-nav {
    top: 32px;
}
@media (max-width: 782px) {
    body.admin-bar .tc-nav {
        top: 46px;
    }
}

.tc-nav__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Logo */
.tc-nav__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.tc-nav__logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--tct-brand, #2563EB);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}
/* Brand-mark image variant — replaces .tc-nav__logo-icon when a real logo
   PNG is rendered via render_site_header() / render_site_footer() (S149).
   Sized to 50×50 to match the new theme header (where Customizer's
   .custom-logo also caps at max-height: 50px). The raw img has no border
   radius / background / shadow because the logo file already carries its
   own purple-gradient shield treatment — applying chrome would double-up. */
.tc-nav__logo-img {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
}
.tc-nav__logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--tct-text, #111);
    letter-spacing: -0.3px;
}

/* Hamburger (mobile only) */
.tc-nav__hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--tct-text, #111);
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
}

/* Desktop menu links */
.tc-nav__menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    margin-left: 8px;
}
.tc-nav__link {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tct-text-secondary, #444);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}
.tc-nav__link:hover {
    background: var(--tct-bg-tertiary, #f5f5f5);
    color: var(--tct-text, #111);
}

/* WordPress assigned menu items — match .tc-nav__link styling */
.tc-nav__menu .menu-item {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}
.tc-nav__menu .menu-item a {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tct-text-secondary, #444);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}
.tc-nav__menu .menu-item a:hover {
    background: var(--tct-bg-tertiary, #f5f5f5);
    color: var(--tct-text, #111);
}
.tc-nav__menu .menu-item.current-menu-item a {
    color: var(--tct-text, #111);
    font-weight: 600;
}

/* Search bar */
.tc-nav__search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--tct-bg-tertiary, #f5f5f5);
    border: 1px solid var(--tct-border, #e5e5e5);
    border-radius: 8px;
    padding: 0 14px;
    height: 38px;
    min-width: 260px;
    max-width: 360px;
    flex-shrink: 1;
    transition: border-color 0.15s;
}
.tc-nav__search:focus-within {
    border-color: var(--tct-brand, #111);
    background: var(--tct-bg-elevated, #fff);
}
.tc-nav__search i {
    color: var(--tct-text-tertiary, #999);
    font-size: 14px;
    flex-shrink: 0;
}
.tc-nav__search-input {
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--tct-text, #111);
    outline: none;
    width: 100%;
    font-family: inherit;
}
.tc-nav__search-input::placeholder {
    color: var(--tct-text-tertiary, #999);
}

/* Icon buttons */
.tc-nav__icons {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.tc-nav__icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--tct-text, #333);
    font-size: 18px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s;
}
.tc-nav__icon-btn:hover {
    background: var(--tct-bg-tertiary, #f5f5f5);
    color: var(--tct-text, #111);
}

/* Badge */
.tc-nav__badge {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    background: var(--tct-error, #dc2626);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* ══════════════════════════════════════════════════════════════════════════════
   MOBILE OFFCANVAS MENU
   ══════════════════════════════════════════════════════════════════════════════ */
.tc-mobile-overlay {
    position: fixed;
    inset: 0;
    background: var(--tct-bg-overlay, rgba(0,0,0,0.4));
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.tc-mobile-overlay.tc-open {
    opacity: 1;
    visibility: visible;
}
.tc-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: var(--tct-bg-elevated, #fff);
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.tc-mobile-menu.tc-open {
    transform: translateX(0);
}
.tc-mobile-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--tct-border-subtle, #eee);
}
.tc-mobile-menu__close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--tct-text-secondary, #666);
    cursor: pointer;
    padding: 4px;
}
.tc-mobile-menu__search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 20px;
    padding: 10px 14px;
    background: var(--tct-bg-tertiary, #f5f5f5);
    border: 1px solid var(--tct-border, #e5e5e5);
    border-radius: 8px;
}
.tc-mobile-menu__search i {
    color: var(--tct-text-tertiary, #999);
    font-size: 15px;
}
.tc-mobile-menu__search input {
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--tct-text, #111);
    outline: none;
    width: 100%;
    font-family: inherit;
}
.tc-mobile-menu__links {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
}
.tc-mobile-menu__links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    font-size: 15px;
    color: var(--tct-text, #333);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.12s;
}
.tc-mobile-menu__links a:hover {
    background: var(--tct-bg-tertiary, #f5f5f5);
}
.tc-mobile-menu__links a i {
    font-size: 17px;
    color: var(--tct-text-secondary, #666);
    width: 22px;
    text-align: center;
}
.tc-mobile-menu__links hr {
    border: none;
    border-top: 1px solid var(--tct-border-subtle, #eee);
    margin: 8px 12px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   FOOTER — page-bg with subtle border, copyright bar inverts to elevated
   ══════════════════════════════════════════════════════════════════════════════ */
.tc-site-footer {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--tct-text, #333);
    line-height: 1.6;
}

.tc-footer__main {
    background: var(--tct-bg-secondary, #fafafa);
    border-top: 1px solid var(--tct-border, #e5e5e5);
    padding: 56px 24px 48px;
}
.tc-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    /* S149 — 5-col layout (Brand+Social / Shop / Categories / Company / Support).
       Brand col gets 1.4fr to absorb the about text and social icons; the
       other four are equal-weight 1fr. Matches the theme.css override at
       `.tct-footer-5col .tc-footer__inner` so plugin-rendered and
       theme-rendered footers share the same column widths. */
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
    gap: 40px;
}

/* Brand col */
.tc-footer__brand .tc-footer__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 16px;
}
.tc-footer__desc {
    font-size: 13px;
    color: var(--tct-text-secondary, #666);
    margin: 0 0 20px;
    max-width: 280px;
}
.tc-footer__social {
    display: flex;
    gap: 8px;
}
.tc-footer__social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--tct-border-strong, #d4d4d4);
    color: var(--tct-text-secondary, #444);
    font-size: 15px;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}
.tc-footer__social a:hover {
    border-color: var(--tct-text, #111);
    color: var(--tct-text, #111);
}

/* Link columns */
.tc-footer__heading {
    font-size: 14px;
    font-weight: 600;
    color: var(--tct-text, #111);
    margin: 0 0 16px;
}
.tc-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.tc-footer__links a {
    font-size: 13px;
    color: var(--tct-text-secondary, #666);
    text-decoration: none;
    transition: color 0.12s;
}
.tc-footer__links a:hover {
    color: var(--tct-text, #111);
}
.tc-footer__links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Newsletter */
.tc-footer__newsletter p {
    font-size: 13px;
    color: var(--tct-text-secondary, #666);
    margin: 0 0 14px;
}
.tc-footer__nl-form {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid var(--tct-border-strong, #d4d4d4);
    transition: border-color 0.15s;
}
.tc-footer__nl-form:focus-within {
    border-color: var(--tct-brand, #111);
}
.tc-footer__nl-form input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    font-size: 13px;
    color: var(--tct-text, #111);
    outline: none;
    font-family: inherit;
    background: var(--tct-bg-elevated, #fff);
}
.tc-footer__nl-form input::placeholder {
    color: var(--tct-text-tertiary, #999);
}
.tc-footer__nl-form button {
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tct-bg-inverse, #111);
    border: none;
    color: var(--tct-text-on-inverse, #fff);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.tc-footer__nl-form button:hover {
    background: var(--tct-brand, #333);
    color: #fff;
}
.tc-footer__nl-form--submitting {
    opacity: 0.6;
    pointer-events: none;
}
.tc-footer__nl-form--done {
    display: none;
}
.tc-footer__nl-msg {
    font-size: 12px;
    line-height: 1.5;
    margin-top: 10px;
    min-height: 18px;
    color: var(--tct-text-secondary, #666);
}
.tc-footer__nl-msg--success {
    color: var(--tct-success-text, #157A5E);
    font-weight: 500;
}
.tc-footer__nl-msg--error {
    color: var(--tct-error-text, #C84646);
}

/* Bottom bar */
.tc-footer__bottom {
    background: var(--tct-bg-elevated, #fff);
    border-top: 1px solid var(--tct-border, #e5e5e5);
    padding: 20px 24px;
    font-size: 12px;
    color: var(--tct-text-tertiary, #888);
}
.tc-footer__bottom-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.tc-footer__bottom p {
    margin: 0;
}
.tc-footer__policy-links {
    display: flex;
    gap: 20px;
}
.tc-footer__policy-links a {
    color: var(--tct-text-tertiary, #888);
    text-decoration: none;
    transition: color 0.12s;
}
.tc-footer__policy-links a:hover {
    color: var(--tct-text, #111);
}
.tc-footer__payments {
    display: flex;
    gap: 8px;
    align-items: center;
}
.tc-footer__payments svg {
    border-radius: 3px;
    box-shadow: var(--tct-shadow-sm, 0 1px 2px rgba(0,0,0,0.08));
}

/* ══════════════════════════════════════════════════════════════════════════════
   WP NAV MENU INTEGRATION
   wp_nav_menu outputs <ul class="menu"><li><a> structure.
   These rules normalize that to match our layout.
   ══════════════════════════════════════════════════════════════════════════════ */

/* Top bar WP menu items (no <ul> wrapper due to items_wrap='%3$s') */
.tc-topbar__links .menu-item {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tc-topbar__links .menu-item a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.15s;
}
.tc-topbar__links .menu-item a:hover {
    color: #fff;
}
[data-theme="dark"] .tc-topbar__links .menu-item a {
    color: rgba(10,10,15,0.6);
}
[data-theme="dark"] .tc-topbar__links .menu-item a:hover {
    color: var(--tct-text-on-inverse, #0A0A0F);
}

/* Main nav WP menu — legacy .menu rules kept for themes that use default items_wrap */
.tc-nav__menu .menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.tc-nav__menu .menu li {
    list-style: none;
}
.tc-nav__menu .menu a {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tct-text-secondary, #444);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    display: block;
}
.tc-nav__menu .menu a:hover {
    background: var(--tct-bg-tertiary, #f5f5f5);
    color: var(--tct-text, #111);
}

/* Mobile menu WP menu items (no <ul> wrapper due to items_wrap='%3$s') */
.tc-mobile-menu__links .menu-item {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tc-mobile-menu__links .menu-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    font-size: 15px;
    color: var(--tct-text, #333);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.12s;
}
.tc-mobile-menu__links .menu-item a:hover {
    background: var(--tct-bg-tertiary, #f5f5f5);
}

/* Footer WP menu — inherits .tc-footer__links styling */
.tc-footer__links.menu,
.tc-footer__col .menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.tc-footer__links.menu li,
.tc-footer__col .menu li {
    list-style: none;
}
.tc-footer__links.menu a,
.tc-footer__col .menu a {
    font-size: 13px;
    color: var(--tct-text-secondary, #666);
    text-decoration: none;
    transition: color 0.12s;
}
.tc-footer__links.menu a:hover,
.tc-footer__col .menu a:hover {
    color: var(--tct-text, #111);
}

/* WP adds .current-menu-item — highlight active */
.tc-nav__menu .current-menu-item > a {
    color: var(--tct-text, #111);
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .tc-nav__menu {
        display: none;
    }
    .tc-nav__search {
        flex: 1;
        max-width: none;
        margin-left: 16px;
    }
    .tc-nav__hamburger {
        display: flex;
        order: -1;
        margin-left: 0;
    }
    .tc-nav__logo {
        order: -2;
    }
    .tc-nav__icons {
        margin-left: auto;
    }

    .tc-footer__inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .tc-footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .tc-topbar {
        display: none;
    }
    .tc-nav__inner {
        padding: 0 16px;
        height: 56px;
        gap: 12px;
    }
    .tc-nav__search {
        display: none;
    }
    .tc-nav__logo-text {
        font-size: 16px;
    }

    .tc-footer__inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .tc-footer__main {
        padding: 40px 16px 32px;
    }
    .tc-footer__bottom-inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   SEARCH SUGGESTIONS DROPDOWN
   ══════════════════════════════════════════════════════════════════════════════ */
.tc-suggest-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 6px;
    background: var(--tct-bg-elevated, #fff);
    border: 1px solid var(--tct-border, #e5e5e5);
    border-radius: 10px;
    box-shadow: var(--tct-shadow, 0 8px 30px rgba(0,0,0,0.12));
    z-index: 1000;
    overflow: hidden;
    max-height: 420px;
    overflow-y: auto;
}

.tc-suggest__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--tct-text, #111);
    transition: background 0.1s;
    border-bottom: 1px solid var(--tct-border-subtle, #f5f5f5);
}
.tc-suggest__item:last-of-type {
    border-bottom: none;
}
.tc-suggest__item:hover {
    background: var(--tct-bg-tertiary, #f8f8f8);
}

.tc-suggest__thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--tct-bg-tertiary, #f5f5f5);
}
.tc-suggest__thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tct-text-tertiary, #ccc);
    font-size: 18px;
}

.tc-suggest__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tc-suggest__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--tct-text, #111);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-suggest__prices {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tc-suggest__price {
    font-weight: 600;
    color: var(--tct-text, #111);
}
.tc-suggest__old-price {
    color: var(--tct-text-tertiary, #999);
    text-decoration: line-through;
    font-weight: 400;
}

.tc-suggest__viewall {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tct-brand, #2563EB);
    text-decoration: none;
    border-top: 1px solid var(--tct-border-subtle, #eee);
    transition: background 0.1s;
}
.tc-suggest__viewall:hover {
    background: var(--tct-brand-soft, #f0f7ff);
}

.tc-suggest__empty {
    padding: 20px 14px;
    text-align: center;
    font-size: 13px;
    color: var(--tct-text-tertiary, #888);
}

/* Mobile: dropdown takes full width */
@media (max-width: 1024px) {
    .tc-suggest-dropdown {
        border-radius: 0 0 10px 10px;
        margin-top: 2px;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   Mega Menu — wide dropdown with 3-level category hierarchy
   ══════════════════════════════════════════════════════════════════════════ */

.tc-mega-parent {
    position: static;              /* dropdown positions relative to .navbar, not this li */
}

.tc-mega-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding-top: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
    z-index: 1050;
}

.tc-mega-parent:hover > .tc-mega-dropdown,
.tc-mega-dropdown:hover {
    opacity: 1;
    visibility: visible;
}

.tc-mega-dropdown__inner {
    background: var(--tct-bg-elevated, #fff);
    border-top: 2px solid var(--tct-text, #111);
    box-shadow: var(--tct-shadow, 0 12px 48px rgba(0,0,0,0.12)), 0 2px 6px rgba(0,0,0,0.04);
    padding: 28px 32px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.tc-mega-dropdown__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tct-border-subtle, #f0f0f0);
}

.tc-mega-dropdown__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--tct-text, #111);
    letter-spacing: -0.3px;
}

.tc-mega-dropdown__viewall {
    font-size: 13px;
    font-weight: 500;
    color: var(--tct-brand, #2563eb);
    text-decoration: none;
    transition: color 0.15s;
}
.tc-mega-dropdown__viewall:hover {
    color: var(--tct-brand-hover, #1d4ed8);
}

/* Multi-column layout for Level 2 groups */
.tc-mega-dropdown__columns {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px 32px;
}

/* Each Level 2 category group */
.tc-mega-dropdown__group {
    padding-bottom: 12px;
    break-inside: avoid;
}

/* Level 2 heading (clickable) */
.tc-mega-dropdown__heading {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--tct-text, #111);
    text-decoration: none;
    padding: 6px 0;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--tct-border-subtle, #f3f4f6);
    transition: color 0.12s;
}
.tc-mega-dropdown__heading:hover {
    color: var(--tct-brand, #2563eb);
}

/* Level 3 links container */
.tc-mega-dropdown__sublinks {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 4px;
}

/* Level 3 link */
.tc-mega-dropdown__link {
    display: block;
    padding: 5px 0 5px 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--tct-text-secondary, #4b5563);
    text-decoration: none;
    transition: color 0.12s;
    line-height: 1.4;
}
.tc-mega-dropdown__link:hover {
    color: var(--tct-text, #111);
}

/* Chevron rotation on hover */
.tc-mega-parent:hover > .nav-link .bi-chevron-down {
    transform: rotate(180deg);
    transition: transform 0.2s ease;
}
.tc-mega-parent > .nav-link .bi-chevron-down {
    transition: transform 0.2s ease;
}

/* Hide mega menu on mobile — subcategories show in offcanvas instead */
@media (max-width: 1199px) {
    .tc-mega-dropdown {
        display: none !important;
    }
    .tc-mega-parent > .nav-link .bi-chevron-down {
        display: none;
    }
}
