/* =============================================
   UPVC – Mobile Header (hidden on desktop)
   ============================================= */

/* Entire mobile header is hidden on desktop */
.upvc-mh {
    display: none;
}

@media (max-width: 768px) {

    .upvc-mh {
        display: block;
        position: relative;
        z-index: 9999;
        width: 100%;
    }

    .upvc-mh__inner {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 16px;
    }

    /* ── Top Bar (Announcements Slider) ── */

    .upvc-mh__topbar {
        background: var(--upvc-mh-topbar-bg, #052530);
        color: var(--upvc-mh-topbar-text, #fff);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 6px 16px;
        font-size: 12px;
        font-weight: 500;
        position: relative;
        overflow: hidden;
    }

    .upvc-mh__topbar-slider {
        position: relative;
        text-align: center;
        min-height: 1.4em;
        flex: 1;
        max-width: 600px;
    }

    .upvc-mh__topbar-slide {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        opacity: 0;
        transition: opacity 0.4s ease;
        white-space: nowrap;
    }

    .upvc-mh__topbar-slide.is-active {
        position: relative;
        opacity: 1;
    }

    .upvc-mh__topbar-arrow {
        background: none;
        border: none;
        color: inherit;
        cursor: pointer;
        padding: 4px;
        opacity: 0.7;
        transition: opacity 0.15s;
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .upvc-mh__topbar-arrow:hover {
        opacity: 1;
    }

    /* ── Main Bar ── */

    .upvc-mh__main {
        background: var(--upvc-mh-bg, #073240);
        color: var(--upvc-mh-text, #fff);
        padding: 10px 0;
    }

    .upvc-mh__main .upvc-mh__inner {
        display: flex;
        align-items: center;
        gap: 12px;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    /* Logo group */
    .upvc-mh__logo-group {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
    }

    /* Logo */
    .upvc-mh__logo {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        text-decoration: none;
        color: inherit;
    }

    .upvc-mh__logo img {
        height: var(--upvc-mh-logo-height, 28px);
        width: auto;
        display: block;
    }

    .upvc-mh__logo-text {
        font-size: 18px;
        font-weight: 700;
        letter-spacing: -0.5px;
        white-space: nowrap;
    }

    /* Badge image next to logo */
    .upvc-mh__logo-badge {
        width: auto;
        display: block;
        flex-shrink: 0;
    }

    /* Icons */
    .upvc-mh__icons {
        display: flex;
        align-items: center;
        gap: 14px;
        flex-shrink: 0;
        margin-left: auto;
    }

    .upvc-mh__icon {
        color: var(--upvc-mh-text, #fff);
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 6px;
        transition: opacity 0.15s;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
    }

    .upvc-mh__icon:hover {
        opacity: 0.8;
    }

    .upvc-mh__cart {
        position: relative;
    }

    .upvc-mh__cart-count {
        position: absolute;
        top: -6px;
        right: -6px;
        background: #8cc73d;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    /* Hamburger */
    .upvc-mh__hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 28px;
        height: 28px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
    }

    .upvc-mh__hamburger span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--upvc-mh-text, #fff);
        border-radius: 2px;
        transition: transform 0.3s, opacity 0.3s;
    }

    /* ── Mobile Search (toggle) ── */

    .upvc-mh__mobile-search {
        display: none;
        width: 100%;
        padding: 0 0 4px;
        order: 10;
    }

    .upvc-mh__mobile-search.is-open {
        display: block;
    }

    /* FiboSearch overrides */
    .upvc-mh__mobile-search .dgwt-wcas-search-wrapp {
        max-width: 100% !important;
    }

    .upvc-mh__mobile-search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp {
        display: flex !important;
        flex-direction: row !important;
    }

    .upvc-mh__mobile-search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
        border-radius: 6px 0 0 6px !important;
        height: 40px !important;
        font-size: 14px !important;
        padding: 0 16px !important;
        border: none !important;
        background: #fff !important;
        color: #333 !important;
        flex: 1 !important;
        order: 1 !important;
    }

    .upvc-mh__mobile-search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit {
        background: transparent !important;
        border-radius: 0 6px 6px 0 !important;
        border: none !important;
        width: 48px !important;
        min-width: 48px !important;
        order: 2 !important;
        position: relative !important;
        right: auto !important;
        left: auto !important;
    }

    /* Standard WP search fallback */
    .upvc-mh__mobile-search .search-form {
        display: flex;
    }

    .upvc-mh__mobile-search .search-form .search-field {
        flex: 1;
        height: 40px;
        border: none;
        border-radius: 6px 0 0 6px;
        padding: 0 16px;
        font-size: 14px;
    }

    .upvc-mh__mobile-search .search-form .search-submit {
        height: 40px;
        padding: 0 20px;
        background: #8cc73d;
        color: #fff;
        border: none;
        border-radius: 0 6px 6px 0;
        font-weight: 600;
        cursor: pointer;
    }

} /* end @media max-width: 768px */


/* ── Mobile Nav Drawer (always available, toggled via JS) ── */

.upvc-mh__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
}

.upvc-mh__overlay.is-open {
    display: block;
}

.upvc-mh__nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85vw;
    max-width: 400px;
    height: 100vh;
    background: var(--upvc-mh-drawer-bg, #fff);
    color: var(--upvc-mh-drawer-text, #333);
    z-index: 99999;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}

.upvc-mh__nav.is-open {
    right: 0;
}

.upvc-mh__nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--upvc-mh-drawer-border, #eee);
    font-weight: 700;
    font-size: 16px;
    color: var(--upvc-mh-drawer-heading, var(--upvc-mh-drawer-text, #333));
}

.upvc-mh__nav-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--upvc-mh-drawer-text, #333);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Icon bar in drawer */
.upvc-mh__nav-icons {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--upvc-mh-drawer-border, #eee);
}

.upvc-mh__nav-icon-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 8px;
    color: var(--upvc-mh-drawer-link, var(--upvc-mh-drawer-text, #333));
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: background 0.15s;
    position: relative;
    border-right: 1px solid var(--upvc-mh-drawer-border, #eee);
}

.upvc-mh__nav-icon-link:last-child {
    border-right: none;
}

.upvc-mh__nav-icon-link:hover {
    background: var(--upvc-mh-drawer-hover, rgba(0,0,0,0.04));
}

.upvc-mh__nav-icon-link svg {
    flex-shrink: 0;
}

.upvc-mh__nav-icon-cart {
    position: relative;
}

.upvc-mh__nav-icon-badge {
    position: absolute;
    top: 8px;
    right: calc(50% - 20px);
    background: var(--upvc-mh-badge-bg, #8cc73d);
    color: var(--upvc-mh-badge-text, #fff);
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Logo in drawer header */
.upvc-mh__nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.upvc-mh__nav-logo img {
    height: 28px;
    width: auto;
    display: block;
}

/* Mobile menu list */
.upvc-mh__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.upvc-mh__menu > li {
    border-bottom: 1px solid var(--upvc-mh-drawer-border, #f0f0f0);
}

.upvc-mh__menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    color: var(--upvc-mh-drawer-link, var(--upvc-mh-drawer-text, #333));
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    gap: 10px;
}

.upvc-mh__menu > li > a:hover {
    background: var(--upvc-mh-drawer-hover, rgba(0,0,0,0.04));
}

/* Menu label (title + optional badge) */
.upvc-mh__menu-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

/* Right arrow icon */
.upvc-mh__arrow {
    flex-shrink: 0;
    opacity: 0.35;
    transition: opacity 0.15s, transform 0.15s;
}

.upvc-mh__menu > li > a:hover .upvc-mh__arrow {
    opacity: 0.7;
    transform: translateX(2px);
}

/* Badge */
.upvc-mh__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    border-radius: 20px;
    background: var(--upvc-mh-badge-bg, #8cc73d);
    color: var(--upvc-mh-badge-text, #fff);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1.4;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Sub-menus */
.upvc-mh__menu > li > .sub-menu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
}

.upvc-mh__menu > li.mobile-submenu-open > .sub-menu {
    display: block;
    background: var(--upvc-mh-drawer-hover, rgba(0,0,0,0.04));
}

.upvc-mh__menu > li > .sub-menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 10px 36px;
    color: var(--upvc-mh-drawer-link, var(--upvc-mh-drawer-text, #555));
    text-decoration: none;
    font-size: 14px;
    border-top: 1px solid var(--upvc-mh-drawer-border, #eee);
    opacity: 0.8;
    gap: 10px;
}

.upvc-mh__menu > li > .sub-menu > li > a .upvc-mh__arrow {
    width: 14px;
    height: 14px;
}

.upvc-mh__menu > li > .sub-menu > li > a:hover {
    background: var(--upvc-mh-drawer-hover, rgba(0,0,0,0.04));
    opacity: 1;
}

/* Parent items with children — rotate arrow when open */
.upvc-mh__menu > li.menu-item-has-children > a .upvc-mh__arrow {
    transition: opacity 0.15s, transform 0.2s;
}

.upvc-mh__menu > li.menu-item-has-children.mobile-submenu-open > a .upvc-mh__arrow {
    transform: rotate(90deg);
    opacity: 0.7;
}

/* Bottom links in drawer */
.upvc-mh__nav-links {
    padding: 16px 20px;
    border-top: 1px solid var(--upvc-mh-drawer-border, #eee);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upvc-mh__nav-links a {
    color: var(--upvc-mh-drawer-link, var(--upvc-mh-drawer-text, #333));
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}
