/* ==========================================================================
   Vendors Listing — Header Widget Styles
   TheBash-style: clean white bar, logo left, nav right, outlined CTA,
   search icon circle, AJAX search dropdown, responsive hamburger.
   ========================================================================== */

/* ---------------------------------------------------------------------
   1. Header Base
   --------------------------------------------------------------------- */
.vl-wrapper.vl-header-wrapper {
    position: relative;
    z-index: 1000;
}

.vl-header-spacer {
    display: none;
}

.vl-header {
    position: relative;
    width: 100%;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* When sticky is enabled, it becomes fixed */
.vl-header--sticky-enabled {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
}

.vl-header--sticky-enabled ~ .vl-header-spacer,
.vl-header-spacer:has(~ .vl-header--sticky-enabled) {
    display: block;
}

/* The spacer sits before the header in DOM;
   JS sets its height equal to the header. */
.vl-header--sticky-enabled + .nothing {
    /* fallback handled by JS */
}

/* Re-order: spacer is before header in DOM, but we let JS handle height */

/* Scrolled state (added by inline JS) */
.vl-header--scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    border-bottom-color: transparent !important;
}

/* WP Admin bar offset */
.admin-bar .vl-header--sticky-enabled {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .vl-header--sticky-enabled {
        top: 46px;
    }
}

/* Override any Elementor inherited colors */
.elementor-page .vl-header,
.e-con .vl-header,
.elementor-widget-container .vl-header {
    color: #1A1A2E !important;
    background: #ffffff !important;
}

.elementor-page .vl-header--scrolled,
.e-con .vl-header--scrolled,
.elementor-widget-container .vl-header--scrolled {
    background: #ffffff !important;
}

/* ---------------------------------------------------------------------
   2. Header Inner — Flexbox layout: logo | nav | actions
   --------------------------------------------------------------------- */
.vl-header__inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    min-height: 72px;
    gap: 24px;
    transition: min-height 0.3s ease, padding 0.3s ease;
}

.vl-header--scrolled .vl-header__inner {
    min-height: 64px;
}

/* ---------------------------------------------------------------------
   3. Logo
   --------------------------------------------------------------------- */
.vl-header__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.vl-header__logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}

.vl-header__logo-img {
    height: 36px;
    width: auto;
    display: block;
}

.vl-header__logo-text {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #1A1A2E !important;
    letter-spacing: -0.03em !important;
    line-height: 1 !important;
    white-space: nowrap;
}

/* Override Elementor link colors on logo text */
.elementor-widget-container .vl-header__logo-text,
.e-con .vl-header__logo-text {
    color: #1A1A2E !important;
}

/* ---------------------------------------------------------------------
   4. Desktop Navigation
   --------------------------------------------------------------------- */
.vl-header__nav {
    display: flex !important;
    align-items: center !important;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.vl-header__nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #636E72 !important;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 8px;
    transition: color 0.25s ease, background-color 0.25s ease;
    white-space: nowrap;
}

.vl-header__nav-link:hover {
    color: #1A1A2E !important;
    background: #F8F9FA !important;
}

.vl-header__nav-link.active {
    color: #1A1A2E !important;
}

/* Underline animation on hover */
.vl-header__nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: #6C5CE7;
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.vl-header__nav-link:hover::after,
.vl-header__nav-link.active::after {
    transform: scaleX(1);
}

/* Override Elementor link colors */
.elementor-widget-container .vl-header__nav-link,
.e-con .vl-header__nav-link {
    color: #636E72 !important;
}

.elementor-widget-container .vl-header__nav-link:hover,
.e-con .vl-header__nav-link:hover {
    color: #1A1A2E !important;
}

/* ---------------------------------------------------------------------
   5. Right Actions Group (CTA + Search icon)
   --------------------------------------------------------------------- */
.vl-header__actions {
    display: flex !important;
    align-items: center !important;
    gap: 12px;
    flex-shrink: 0;
}

/* CTA Button — outlined like TheBash */
.vl-header__cta {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    padding: 10px 24px;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1A1A2E !important;
    border: 2px solid #1A1A2E !important;
    background: transparent !important;
    border-radius: 4px;
    transition: all 0.25s ease;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1.4 !important;
}

.vl-header__cta:hover {
    background: #1A1A2E !important;
    color: #ffffff !important;
}

/* Override Elementor link colors */
.elementor-widget-container .vl-header__cta,
.e-con .vl-header__cta {
    color: #1A1A2E !important;
}

.elementor-widget-container .vl-header__cta:hover,
.e-con .vl-header__cta:hover {
    color: #ffffff !important;
}

/* Search Icon — circle button */
.vl-header__search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    border: none !important;
    background: #6C5CE7 !important;
    color: #ffffff !important;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.vl-header__search-toggle:hover {
    background: #5A4BD1 !important;
    transform: scale(1.05);
}

.vl-header__search-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

/* ---------------------------------------------------------------------
   6. AJAX Search Dropdown
   --------------------------------------------------------------------- */
.vl-header__search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 12px 40px -4px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 12px 12px;
    max-height: 400px;
    overflow: hidden;
    z-index: 999;
    animation: vlSearchSlideDown 0.25s ease forwards;
}

.vl-header__search-dropdown--open {
    display: block !important;
}

@keyframes vlSearchSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search inner (input + close) */
.vl-header__search-inner {
    display: flex;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    border-bottom: 1px solid #E2E8F0;
}

.vl-header__search-input {
    flex: 1;
    width: 100%;
    height: 56px;
    padding: 0;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 18px !important;
    font-weight: 400;
    color: #1A1A2E;
    line-height: 56px;
    box-shadow: none !important;
}

.vl-header__search-input::placeholder {
    color: #a0a0b0;
}

.vl-header__search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: none !important;
    background: #F0F0F4 !important;
    color: #636E72;
    font-size: 20px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.vl-header__search-close:hover {
    background: #E2E8F0 !important;
    color: #1A1A2E;
}

/* Search results container */
.vl-header__search-results {
    max-height: 340px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Individual result item */
.vl-header__search-result {
    display: flex !important;
    align-items: center;
    gap: 14px;
    padding: 12px 32px;
    text-decoration: none !important;
    color: #1A1A2E !important;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.vl-header__search-result:hover {
    background: #F8F9FA !important;
}

/* Result thumbnail */
.vl-header__search-result-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #F0F0F4;
}

.vl-header__search-result-img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0a0b0;
}

.vl-header__search-result-img--placeholder svg {
    width: 24px;
    height: 24px;
}

/* Result info */
.vl-header__search-result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.vl-header__search-result-info strong {
    font-size: 15px;
    font-weight: 600;
    color: #1A1A2E;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vl-header__search-result-info span {
    font-size: 13px;
    font-weight: 400;
    color: #636E72;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading spinner */
.vl-header__search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.vl-header__search-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #E2E8F0;
    border-top-color: #6C5CE7;
    border-radius: 50%;
    animation: vlSearchSpin 0.7s linear infinite;
}

@keyframes vlSearchSpin {
    to { transform: rotate(360deg); }
}

/* No results message */
.vl-header__search-empty {
    padding: 28px 32px;
    text-align: center;
    color: #636E72;
    font-size: 15px;
    font-weight: 500;
}

/* "Showing X of Y" message */
.vl-header__search-more {
    padding: 12px 32px;
    text-align: center;
    color: #a0a0b0;
    font-size: 13px;
    font-weight: 500;
    border-top: 1px solid #E2E8F0;
}

/* Override Elementor link colors on search results */
.elementor-widget-container .vl-header__search-result,
.e-con .vl-header__search-result {
    color: #1A1A2E !important;
}

/* ---------------------------------------------------------------------
   7. Hamburger Button — 3 lines, animated to X
   --------------------------------------------------------------------- */
.vl-header__hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    background: none !important;
    border: none !important;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.25s ease;
    flex-shrink: 0;
}

.vl-header__hamburger:hover {
    background: #F8F9FA !important;
}

/* Legacy <span> bars (kept for backwards-compat, hidden) */
.vl-header__hamburger span {
    display: none !important;
}

/* Dual-icon approach: menu and close icons stacked, toggle via --open class */
.vl-header__hamburger {
    position: relative !important;
}

.vl-header__hamburger-icon {
    color: #1A1A2E !important;
    transition: opacity 0.2s ease, transform 0.25s ease !important;
    pointer-events: none !important;
}

.vl-header__hamburger-icon--menu {
    opacity: 1 !important;
    transform: rotate(0deg) !important;
}

.vl-header__hamburger-icon--close {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    opacity: 0 !important;
    transform: translate(-50%, -50%) rotate(-90deg) !important;
}

/* Open state: swap icons */
.vl-header__hamburger.vl-header__hamburger--open .vl-header__hamburger-icon--menu {
    opacity: 0 !important;
    transform: rotate(90deg) !important;
}

.vl-header__hamburger.vl-header__hamburger--open .vl-header__hamburger-icon--close {
    opacity: 1 !important;
    transform: translate(-50%, -50%) rotate(0deg) !important;
}

/* ---------------------------------------------------------------------
   8. Mobile Menu — off-canvas slide-down
   --------------------------------------------------------------------- */
.vl-header__mobile-menu {
    display: block;
    background: #ffffff !important;
    border-top: 1px solid #E2E8F0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, visibility 0.3s;
}

.vl-header__mobile-menu--open {
    max-height: 600px !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.vl-header__mobile-nav {
    padding: 16px 24px 24px;
}

.vl-header__mobile-link {
    display: block;
    padding: 14px 0;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #1A1A2E !important;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #E2E8F0;
    transition: color 0.25s ease, padding-left 0.25s ease;
}

.vl-header__mobile-link:hover {
    color: #6C5CE7 !important;
    padding-left: 8px;
}

.vl-header__mobile-link:last-of-type {
    border-bottom: none;
}

/* Override Elementor link colors on mobile links */
.elementor-widget-container .vl-header__mobile-link,
.e-con .vl-header__mobile-link {
    color: #1A1A2E !important;
}

/* Mobile CTA */
.vl-header__mobile-cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid #E2E8F0;
}

.vl-header__mobile-cta .vl-header__cta {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 15px !important;
}

/* ---------------------------------------------------------------------
   9. Header Spacer — visible only when sticky is enabled
   JS sets the height to match the header
   --------------------------------------------------------------------- */
.vl-header-spacer {
    /* Height set by JS when sticky is enabled */
}

/* ---------------------------------------------------------------------
   10. Responsive — Desktop default (> 768px handled by inline <style>)
   The inline scoped styles use the widget breakpoint setting.
   Below are fallback / baseline responsive rules.
   --------------------------------------------------------------------- */

/* Tablet */
@media (max-width: 1024px) {
    .vl-header__inner {
        padding: 0 24px;
    }

    .vl-header__search-inner {
        padding: 0 24px;
    }

    .vl-header__search-result {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .vl-header__inner {
        padding: 0 16px;
        min-height: 64px;
    }

    .vl-header--scrolled .vl-header__inner {
        min-height: 56px;
    }

    .vl-header__logo-img {
        height: 44px;
    }

    .vl-header__logo-text {
        font-size: 18px !important;
    }

    /* On mobile, search icon stays visible next to hamburger — tightened */
    .vl-header__actions {
        gap: 2px !important;
    }

    .vl-header__search-toggle {
        width: 38px;
        height: 38px;
    }

    .vl-header__search-toggle svg {
        width: 16px;
        height: 16px;
    }

    .vl-header__cart-toggle {
        width: 38px !important;
        height: 38px !important;
    }

    .vl-header__cart-toggle svg {
        width: 19px !important;
        height: 19px !important;
    }

    .vl-header__hamburger {
        margin-left: 2px;
    }

    .vl-header__mobile-nav {
        padding: 12px 16px 20px;
    }

    .vl-header__mobile-link {
        padding: 12px 0;
        font-size: 15px !important;
    }

    /* Search dropdown adjustments */
    .vl-header__search-inner {
        padding: 0 16px;
    }

    .vl-header__search-input {
        height: 48px;
        font-size: 16px !important;
        line-height: 48px;
    }

    .vl-header__search-result {
        padding: 10px 16px;
        gap: 12px;
    }

    .vl-header__search-result-img {
        width: 38px;
        height: 38px;
    }

    .vl-header__search-empty,
    .vl-header__search-more {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .vl-header__inner {
        padding: 0 12px;
        min-height: 56px;
    }

    .vl-header--scrolled .vl-header__inner {
        min-height: 52px;
    }

    .vl-header__logo-img {
        height: 38px;
    }

    .vl-header__logo-text {
        font-size: 16px !important;
    }

    .vl-header__actions {
        gap: 0 !important;
    }

    .vl-header__search-toggle,
    .vl-header__cart-toggle {
        width: 36px !important;
        height: 36px !important;
    }

    .vl-header__search-toggle svg {
        width: 15px !important;
        height: 15px !important;
    }

    .vl-header__cart-toggle svg {
        width: 18px !important;
        height: 18px !important;
    }

    .vl-header__hamburger {
        margin-left: 0;
    }
}

/* Scrollbar styling for search results */
.vl-header__search-results::-webkit-scrollbar {
    width: 6px;
}

.vl-header__search-results::-webkit-scrollbar-track {
    background: transparent;
}

.vl-header__search-results::-webkit-scrollbar-thumb {
    background: #D0D0D8;
    border-radius: 3px;
}

.vl-header__search-results::-webkit-scrollbar-thumb:hover {
    background: #B0B0B8;
}
