/* Zero out any top margin / padding on body and containers */
html,
body,
#outer-wrap,
#wrap,
#site-header-wrap {
}

#top-bar-wrap,
#top-bar,
.has-no-content {
}

/* ==========================================================================
   TUBOVENT - CUSTOM HEADER STYLES (POLISHED & FULLY RESPONSIVE)
   ========================================================================== */

/* Remove any legacy mobile contact bar completely */
#mobile-contact-bar,
.mobile-contact-bar,
#mcb-wrap,
.mcb-wrap {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* 1. TOP BAR */
.tb-header-top {
    background-color: #0b1120;
    color: #94a3b8;
    font-size: 13px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1001;
    width: 100%;
    box-sizing: border-box;
}

.tb-top-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
}

.tb-top-left,
.tb-top-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.tb-top-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.tb-top-item svg {
    color: #ea580c;
    flex-shrink: 0;
}

.tb-top-item a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tb-top-item a:hover {
    color: #fb923c;
}

.tb-top-phone {
    font-weight: 700;
    color: #ffffff !important;
    letter-spacing: 0.3px;
}

.tb-top-phone span {
    white-space: nowrap !important;
}

.tb-top-phone svg {
    color: #ea580c !important;
}

.tb-top-phone:hover {
    color: #fb923c !important;
}

/* 2. MAIN HEADER */
#site-header.tb-header-main {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
    position: relative !important;
    z-index: 1000 !important;
    padding: 0 !important;
    height: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.tb-main-header-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    box-sizing: border-box;
    width: 100%;
}

/* Logo */
.tb-logo-col {
    flex-shrink: 0;
    margin-right: 15px;
}

.tb-logo-link {
    display: block;
    line-height: 1;
    text-decoration: none;
}

.tb-logo-img {
    height: 46px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Desktop Navigation Menu */
.tb-nav-col {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0; /* Crucial: allows flex items to calculate correctly */
    margin: 0 10px;
}

.tb-navbar-nav {
    display: flex !important;
    align-items: center !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 2px;
    flex-wrap: nowrap;
}

.tb-navbar-nav > li {
    position: relative !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0;
}

.tb-navbar-nav > li > a {
    display: inline-flex !important;
    align-items: center !important;
    padding: 8px 10px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    text-decoration: none !important;
    border-radius: 6px !important;
    transition: all 0.15s ease !important;
    white-space: nowrap !important;
    line-height: 1.3 !important;
}

.tb-navbar-nav > li:hover > a {
    color: #ea580c !important;
    background-color: #f8fafc !important;
}

/* Submenu caret */
.tb-navbar-nav li.menu-item-has-children > a::after {
    content: "" !important;
    display: inline-block !important;
    width: 5px !important;
    height: 5px !important;
    border-right: 2px solid currentColor !important;
    border-bottom: 2px solid currentColor !important;
    transform: rotate(45deg) !important;
    margin-left: 5px !important;
    margin-top: -3px !important;
    transition: transform 0.2s ease !important;
}

.tb-navbar-nav li.menu-item-has-children:hover > a::after {
    transform: rotate(-135deg) !important;
    margin-top: 1px !important;
}

/* Submenu dropdown panel */
.tb-navbar-nav .sub-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    min-width: 250px !important;
    background: #ffffff !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12) !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 8px 0 !important;
    list-style: none !important;
    margin: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(8px) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    z-index: 1050 !important;
    pointer-events: none !important;
}

.tb-navbar-nav li:hover > .sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

.tb-navbar-nav .sub-menu li {
    position: relative !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.tb-navbar-nav .sub-menu li a {
    display: block !important;
    padding: 8px 18px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    text-decoration: none !important;
    transition: all 0.15s ease !important;
    line-height: 1.4 !important;
    white-space: normal !important;
}

.tb-navbar-nav .sub-menu li:hover > a {
    background-color: #fff7ed !important;
    color: #ea580c !important;
    padding-left: 22px !important;
}

/* Nested 2nd level sub-menu */
.tb-navbar-nav .sub-menu .sub-menu {
    top: 0 !important;
    left: 100% !important;
    margin-left: 2px !important;
}

/* Actions Column */
.tb-actions-col {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.tb-header-icon-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tb-header-icon-btn:hover {
    background: #ea580c;
    border-color: #ea580c;
    color: #ffffff !important;
}

.tb-header-icon-btn svg {
    color: inherit;
}

.tb-account-btn {
    width: auto;
    padding: 0 12px;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

.tb-account-btn:hover {
    color: #ffffff !important;
}

/* Cart Button */
.tb-cart-dropdown-wrapper {
    position: relative;
    flex-shrink: 0;
}

.tb-header-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ea580c;
    color: #ffffff !important;
    padding: 7px 14px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.tb-header-cart-btn:hover {
    background: #c2410c;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
    transform: translateY(-1px);
}

.tb-cart-icon-box {
    position: relative;
    display: flex;
    align-items: center;
}

.tb-cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #0f172a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

.tb-cart-details {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.15;
}

.tb-cart-lbl {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.tb-cart-total-amount {
    font-size: 12.5px;
    font-weight: 800;
}

/* Mini Cart Popover */
.tb-mini-cart-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    max-width: 90vw;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1100;
    pointer-events: none;
}

.tb-cart-dropdown-wrapper:hover .tb-mini-cart-popover,
.tb-mini-cart-popover.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.tb-mini-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.tb-mini-cart-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.tb-view-cart-link {
    font-size: 12px;
    font-weight: 700;
    color: #ea580c;
    text-decoration: none;
}

.tb-mini-cart-popover .woocommerce-mini-cart__empty-message {
    margin: 15px 0;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

.tb-mini-cart-popover ul.cart_list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f8fafc;
}

.tb-mini-cart-popover ul.cart_list li img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.tb-mini-cart-popover .woocommerce-mini-cart__total {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
}

.tb-mini-cart-popover .woocommerce-mini-cart__buttons a {
    display: block;
    text-align: center;
    padding: 9px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    margin-top: 6px;
}

.tb-mini-cart-popover .woocommerce-mini-cart__buttons a.button:first-child {
    background: #f1f5f9;
    color: #1e293b;
}

.tb-mini-cart-popover .woocommerce-mini-cart__buttons a.button.checkout {
    background: #ea580c;
    color: #ffffff;
}

/* Mobile Toggle */
.tb-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px;
    cursor: pointer;
    flex-shrink: 0;
}

.tb-mobile-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #0f172a;
    border-radius: 2px;
    transition: all 0.2s ease;
}

/* Quick Search Dropdown */
.tb-header-search-bar {
    background: #0f172a;
    padding: 14px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tb-search-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tb-search-inner > div {
    flex: 1;
}

.tb-search-close {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.tb-search-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 3. MOBILE OFFCANVAS DRAWER (SLIDE IN FROM RIGHT TO LEFT) */
.tb-mobile-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 999998 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
    pointer-events: none;
}

.tb-mobile-overlay.is-active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.tb-mobile-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 320px !important;
    max-width: 86vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #ffffff !important;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.25) !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(100%) !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    pointer-events: none;
    visibility: hidden;
}

.tb-mobile-drawer.is-active {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.tb-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.tb-drawer-close {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.tb-drawer-close:hover {
    background: #e2e8f0;
}

.tb-drawer-search {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.tb-drawer-search-form {
    display: flex;
}

.tb-drawer-search-form input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 13px;
}

.tb-drawer-search-form button {
    background: #ea580c;
    color: #ffffff;
    border: none;
    padding: 0 14px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
}

.tb-drawer-nav {
    flex: 1;
    padding: 10px 0;
}

.tb-mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tb-mobile-nav-list li {
    border-bottom: 1px solid #f1f5f9;
}

.tb-mobile-nav-list li a {
    display: block;
    padding: 12px 20px;
    font-size: 14.5px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
}

.tb-mobile-nav-list li.menu-item-has-children > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tb-mobile-nav-list .sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #f8fafc;
    display: none;
}

.tb-mobile-nav-list .sub-menu li a {
    padding: 10px 20px 10px 32px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

.tb-drawer-footer {
    padding: 18px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.tb-drawer-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
}

.tb-drawer-action-btn.tb-call {
    background: #059669;
    color: #ffffff !important;
}

.tb-drawer-action-btn.tb-wa {
    background: #25d366;
    color: #ffffff !important;
}

.tb-drawer-action-btn.tb-account {
    background: #f1f5f9;
    color: #1e293b !important;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (PREVENTS ANY OVERFLOW)
   ========================================================================== */

/* Large screens: tighten nav padding to prevent cart being pushed right */
@media (max-width: 1280px) {
    .tb-navbar-nav > li > a {
        padding: 8px 8px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 1200px) {
    .tb-navbar-nav > li > a {
        padding: 7px 6px !important;
        font-size: 12.5px !important;
    }
    .tb-account-btn .tb-btn-caption {
        display: none !important;
    }
    .tb-account-btn {
        width: 40px !important;
        padding: 0 !important;
        justify-content: center !important;
    }
}

/* Breakpoint to mobile menu at 1120px to cleanly avoid any squeezing */
@media (max-width: 1120px) {
    .tb-nav-col {
        display: none !important;
    }
    .tb-mobile-toggle {
        display: flex !important;
    }
}

@media (max-width: 900px) {
    .tb-hide-tablet {
        display: none !important;
    }
}

/* Mobile top bar and header */
@media (max-width: 640px) {
    .tb-header-top {
        padding: 6px 0 !important;
    }

    .tb-top-container {
        padding: 0 14px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }

    .tb-top-left {
        display: flex !important;
        align-items: center !important;
        gap: 0 !important;
    }

    .tb-top-phone {
        font-size: 13px !important;
        font-weight: 700 !important;
        color: #ffffff !important;
        white-space: nowrap !important;
        letter-spacing: 0.2px !important;
    }

    .tb-top-phone svg {
        width: 13px !important;
        height: 13px !important;
    }

    .tb-top-phone span {
        white-space: nowrap !important;
    }

    .tb-top-right {
        display: flex !important;
        align-items: center !important;
        gap: 0 !important;
    }

    .tb-top-hours {
        font-size: 11.5px !important;
        color: #94a3b8 !important;
        white-space: nowrap !important;
    }

    .tb-top-hours svg {
        width: 12px !important;
        height: 12px !important;
    }

    .tb-hide-mobile {
        display: none !important;
    }

    .tb-main-header-container {
        padding: 8px 14px !important;
        min-height: 60px !important;
    }

    .tb-logo-img {
        height: 36px !important;
    }

    .tb-actions-col {
        gap: 6px !important;
    }

    .tb-header-icon-btn,
    .tb-mobile-toggle {
        width: 36px !important;
        height: 36px !important;
        padding: 8px !important;
    }

    .tb-header-cart-btn {
        padding: 6px 10px !important;
    }

    .tb-cart-details {
        display: none !important;
    }
}
