/* =====================================================================
   Topbar — left contacts | right CMS links + flag language switcher
   ===================================================================== */

#header-top-bar > .container-fluid,
.topbar-wrapper > .container-fluid {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center;
    gap: 1rem;
}

/* left side: phone / email / whatsapp */
.topbar-contacts {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
@media (min-width: 992px) {
    .topbar-contacts { display: inline-flex; }
}

.topbar-contact-item { display: inline-flex; align-items: center; }
.topbar-contact-item:not(:last-child)::after {
    content: "";
    width: 1px;
    height: 12px;
    margin: 0 0.5rem;
    background: rgba(255, 255, 255, 0.18);
}

.topbar-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.5rem !important;
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.8125rem;
    line-height: 1;
    text-decoration: none !important;
    transition: color 0.2s ease;
}
.topbar-contact-link:hover,
.topbar-contact-link:focus { color: #ffffff !important; }
.topbar-contact-link i {
    color: #E2192C;
    font-size: 0.875rem;
    width: 14px;
    text-align: center;
}
.topbar-contact-whatsapp i { color: #25D366; }

/* right side: keep language switcher rightmost regardless of DOM order */
.topbar-main { margin-left: auto; }
.topbar-main .language-switcher { order: 99; }
.topbar-main .currency-dropdown { order: 98; }

/* flat language switcher (no dropdown) */
.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.25rem;
}
.lang-flag-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.78rem;
    line-height: 1;
    text-decoration: none !important;
    transition: background-color 0.2s ease, color 0.2s ease;
    border: 1px solid transparent;
}
.lang-flag-link:hover,
.lang-flag-link:focus {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08);
}
.lang-flag-link.active {
    color: #ffffff !important;
    background: rgba(226, 25, 44, 0.85);
    border-color: rgba(255, 255, 255, 0.15);
}
.lang-flag-link .flag-iso { font-weight: 600; letter-spacing: 0.04em; }

/* SVG flag icon */
.flag-svg {
    display: inline-block;
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
    vertical-align: middle;
}
.flag-iso { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; }

/* compact: hide ISO label, keep only flags below xl */
@media (max-width: 1199.98px) {
    .lang-flag-link .flag-iso { display: none; }
    .lang-flag-link { padding: 0.2rem 0.4rem; }
}

/* =====================================================================
   "More" dropdown (overflow CMS links from topbar)
   ===================================================================== */
.topbar-main { flex-wrap: nowrap !important; min-width: 0; }
.topbar-main .topbar-cms-item .nav-link { white-space: nowrap; }
.topbar-main .topbar-more { order: 98; }
.topbar-main .topbar-more > .nav-link.dropdown-toggle {
    color: rgba(255, 255, 255, 0.85) !important;
    cursor: pointer;
    font-weight: 500;
}
.topbar-main .topbar-more > .nav-link.dropdown-toggle:hover { color: #ffffff !important; }
.topbar-more-menu {
    background: #1f2227;
    color: #1F2227;
    border-radius: 0.6rem;
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.12);
    border: 0;
    padding: 0.5rem 0;
    min-width: 200px;
}
.topbar-more-menu .dropdown-item {
    color: #1F2227;
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.topbar-more-menu .dropdown-item:hover,
.topbar-more-menu .dropdown-item:focus {
    background: rgba(226, 25, 44, 0.08);
    color: #E2192C;
}

/* =====================================================================
   Sticky header — light box-shadow when page is scrolled
   ===================================================================== */
header.fixed-navbar {
    transition: padding 0.25s cubic-bezier(.2,.7,.25,1);
    z-index: 1030;
    /* never clip dropdowns that escape the floating capsule */
    overflow: visible;
}
header.fixed-navbar > .container,
header.fixed-navbar > .container-fluid,
header.fixed-navbar nav.navbar,
header.fixed-navbar .navbar-collapse,
header.fixed-navbar .navbar-nav {
    overflow: visible;
}

@media (min-width: 992px) {
    /* when the page is scrolled, lift the header out of normal flow
       so it stays glued to the viewport top with a soft shadow */
    header.fixed-navbar.is-scrolled,
    header#jtl-nav-wrapper.is-scrolled {
        padding: 1rem 1.25rem 1.25rem;
        transition: padding .25s cubic-bezier(.2, .7, .25, 1);
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
    }
    header.fixed-navbar.is-scrolled > .container,
    header.fixed-navbar.is-scrolled > .container-fluid {
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1),
                    0 0 0 1px rgba(230, 232, 236, 0.5);
        background-color: #ffffff;
    }
    /* placeholder gets the same height as the header so content
       below doesn't jump when the header switches to position:fixed */
    body.has-fixed-header .fixed-navbar-spacer { display: block; }
}
.fixed-navbar-spacer { display: none; height: 0; }

/* =====================================================================
   Search modal — local product suggestions dropdown
   ===================================================================== */
.vlp-search-modal__form { position: relative; }
.vlp-suggest-box {
    position: absolute;
    top: calc(100% + 0.6rem);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.18);
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.4rem;
    display: none;
    z-index: 5;
}
.vlp-suggest-box.is-open { display: block; }
.vlp-suggest-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.5rem;
    color: #1F2227;
    text-decoration: none !important;
    transition: background-color .15s ease;
}
.vlp-suggest-item:hover,
.vlp-suggest-item:focus,
.vlp-suggest-item.is-active {
    background: #FDECEE;
    color: #1F2227;
}
.vlp-suggest-img {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 0.4rem;
    background: #F7F8FA;
    display: block;
}
.vlp-suggest-img--ph {
    background: #F0F2F4;
    background-image: linear-gradient(135deg, transparent 49%, #E0E3E7 49%, #E0E3E7 51%, transparent 51%);
}
.vlp-suggest-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}
.vlp-suggest-name {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vlp-suggest-sku {
    font-size: 0.76rem;
    color: #6B7280;
    margin-top: 2px;
}

/* =====================================================================
   Megamenu / navbar dropdown — always render BELOW the sticky header
   Position the megamenu relative to the navbar/capsule so it spans
   the FULL width of the navigation bar. data-display="static" disables
   Popper so our CSS positions the menu reliably while scrolled.
   ===================================================================== */
@media (min-width: 992px) {
    /* navbar (the capsule's inner row) becomes the positioning context */
    header.fixed-navbar nav.navbar { position: relative; }

    /* small (non-mega) dropdowns stay anchored to their <li> */
    header.fixed-navbar .navbar-nav > .dropdown { position: relative; }
    header.fixed-navbar .navbar-nav > .dropdown > .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: auto !important;
        margin-top: 0.75rem;
        z-index: 1031;
        will-change: transform, opacity;
    }

    /* megamenu spans the FULL navbar width (== capsule width) */
    header.fixed-navbar .navbar-nav > .dropdown.dropdown-full,
    header.fixed-navbar .navbar-nav > .dropdown:has(> .dropdown-menu.megamenu),
    header.fixed-navbar .navbar-nav > .dropdown:has(> .dropdown-menu.full-width-mega) {
        position: static;
    }
    header.fixed-navbar .navbar-nav > .dropdown.dropdown-full > .dropdown-menu,
    header.fixed-navbar .navbar-nav > .dropdown > .dropdown-menu.megamenu,
    header.fixed-navbar .navbar-nav > .dropdown > .dropdown-menu.full-width-mega {
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        transform-origin: top center;
    }
    header.fixed-navbar .navbar-nav > .dropdown > .dropdown-menu.megamenu:not(.show),
    header.fixed-navbar .navbar-nav > .dropdown > .dropdown-menu.full-width-mega:not(.show),
    header.fixed-navbar .navbar-nav > .dropdown.dropdown-full > .dropdown-menu:not(.show) {
        transform: translateY(-0.5rem) scale(.98) !important;
    }
    header.fixed-navbar .navbar-nav > .dropdown > .dropdown-menu.megamenu.show,
    header.fixed-navbar .navbar-nav > .dropdown > .dropdown-menu.full-width-mega.show,
    header.fixed-navbar .navbar-nav > .dropdown.show > .dropdown-menu.megamenu,
    header.fixed-navbar .navbar-nav > .dropdown.show > .dropdown-menu.full-width-mega,
    header.fixed-navbar .navbar-nav > .dropdown.dropdown-full.show > .dropdown-menu {
        transform: translateY(0) scale(1) !important;
    }
}

/* mobile: hide contact text labels, keep icons only */
@media (max-width: 1199.98px) {
    .topbar-contact-label { display: none; }
    .topbar-contact-link { padding: 0.25rem 0.4rem !important; }
    .topbar-contact-item:not(:last-child)::after { margin: 0 0.25rem; }
}
