/* =============================================================================
   HEADER
   ============================================================================= */


/* -----------------------------------------------------------------------------
   OSNOVA
   ----------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-background);
    padding: 0;
    margin: 0;
    width: 100%;
}


/* -----------------------------------------------------------------------------
   ZGORNJA VRSTICA — skupno
   ----------------------------------------------------------------------------- */

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 86px;
    min-height: 86px;
    background-color: var(--color-background);
    position: relative;
    margin: 0;
    padding: 0 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--color-primary);
    clip-path: polygon(0 0, 60% 0, calc(60% - 30px) 100%, 0 100%);
    width: 100%;
    height: 100%;
    padding: 0 1.5rem;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
}


/* -----------------------------------------------------------------------------
   LOGO
   ----------------------------------------------------------------------------- */

.header-logo a {
    display: flex;
    align-items: center;
}

.site-header .header-logo .site-logo {
    display: block;
    height: 42px;
    width: auto;
    max-width: none;
}


/* -----------------------------------------------------------------------------
   IKONE — skupno
   ----------------------------------------------------------------------------- */

.header-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    text-decoration: none;
    color: var(--color-text);
}

.icon-label {
    font-family: var(--font-body);
    font-size: 12px;
}


/* -----------------------------------------------------------------------------
   HAMBURGER — mobile
   ----------------------------------------------------------------------------- */

.header-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    margin-top: 15px;
}

.header-menu-toggle .icon-label {
    color: var(--color-background);
    font-size: 12px;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--color-background);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}


/* -----------------------------------------------------------------------------
   MOBILE IKONE
   ----------------------------------------------------------------------------- */

.header-icons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    z-index: 2;
    margin-left: auto;
    margin-top: 15px;
}


/* -----------------------------------------------------------------------------
   MOBILE SEARCH
   ----------------------------------------------------------------------------- */

.header-search {
    padding: 0.75rem 0;
}


/* -----------------------------------------------------------------------------
   MOBILE NAV SIDEBAR
   ----------------------------------------------------------------------------- */

.mobile-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    height: calc(100vh - var(--header-height));
    width: 80vw;
    max-width: 320px;
    background-color: var(--color-white);
    z-index: 200;
    padding: 2rem 1.5rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    color: var(--color-primary);
}

.mobile-nav.is-open {
    transform: translateX(0);
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.1);
    z-index: 199;
}

.mobile-nav-overlay.is-visible {
    display: block;
}

.mobile-nav-close-btn {
    position: fixed;
    padding: 12px;
    top: 33vh;
    left: calc(80vw + 1rem);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 201;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-nav-close-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-close-btn img {
    width: 100%;
    height: 100%;
    display: block;
}


/* -----------------------------------------------------------------------------
   NAV MENU ELEMENTI — skupno (mobile + dropdown)
   ----------------------------------------------------------------------------- */

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

.mobile-nav-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--color-primary);
    font-family: var(--font-body);
    font-size: var(--text-body);
    padding: 0.875rem 0;
    text-decoration: none;
}

.mobile-nav-list li a::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background-image: url('../assets/icons/Puscica.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.menu-item-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
    color: var(--color-primary);
    font-family: var(--font-body);
    font-size: var(--text-body-2);
    padding: 0.875rem 0;
    text-decoration: none;
}

.menu-item-link::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background-image: url('../assets/icons/Puscica.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.menu-cat-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.menu-item-title {
    flex: 1;
}


/* -----------------------------------------------------------------------------
   FIBOSEARCH — reset
   ----------------------------------------------------------------------------- */

.dgwt-wcas-search-form,
.dgwt-wcas-sf-wrapp {
    background: transparent !important;
}


/* -----------------------------------------------------------------------------
   SHOW / HIDE
   ----------------------------------------------------------------------------- */

.header-mobile-only {
    display: flex;
}

.header-desktop-only {
    display: none !important;
}

/* =============================================================================
   DESKTOP (@media min-width: 769px)
   ============================================================================= */

@media (min-width: 769px) {

    /* --- Show/hide --- */

    .header-mobile-only {
        display: none !important;
    }

    .header-desktop-only {
        display: block !important;
    }


    /* --- Logo --- */

    .site-header .header-logo .site-logo {
        height: 52px;
        width: 125px;
        object-fit: contain;
        max-width: none;
    }


    /* --- Zgornja vrstica --- */

    .header-main {
        height: 108px;
        min-height: 108px;
        overflow: visible;
    }

    .header-left {
        position: absolute;
        width: 100%;
        clip-path: polygon(0 0, 28% 0, calc(28% - 40px) 100%, 0 100%);
    }

    .header-nav-desktop {
        display: flex !important;
        align-items: center;
        height: 100%;
        width: 100%;
        padding-left: 28%;
        justify-content: center;
        position: relative;
        z-index: 2;
        pointer-events: none;
    }

    .desktop-nav-list {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        list-style: none;
        margin: 0;
        padding: 0;
        column-gap: 1.5rem;
        height: 100%;
        width: 100%;
    }

    .desktop-nav-list li {
        display: flex;
        align-items: center;
        height: 100%;
    }

    .desktop-nav-list li a {
        display: flex;
        align-items: center;
        height: 100%;
        color: var(--color-primary);
        font-family: var(--font-body);
        font-size: var(--text-body-2);
        text-decoration: none;
        text-transform: uppercase;
        white-space: nowrap;
        padding: 0 0.5rem;
        transition: opacity 0.2s ease;
        pointer-events: auto;
    }

    .desktop-nav-list li a:hover {
        opacity: 0.7;
    }


    /* --- Spodnja vrstica --- */

    .header-bottom {
        width: 100%;
        border-top: 1px solid rgba(10, 71, 52, 0.1);
    }

    .header-bottom-inner {
        max-width: var(--container-width);
        margin: 0 auto;
        padding: 30px var(--container-padding-desktop);
        display: flex;
        align-items: center;
        gap: var(--gap);
    }

    .header-bottom-sidebar {
        width: var(--sidebar-width);
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }

    .header-bottom-content {
        width: var(--content-width);
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }

    .header-search-desktop {
        flex: 1;
    }

    .header-icons-desktop {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1.5rem;
        flex-shrink: 0;
    }


    /* --- Kategorije gumb --- */

    .header-category-dropdown {
        position: relative;
        width: 100%;
    }

    .header-category-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--color-primary);
        color: var(--color-background);
        border: none;
        padding: 10px 36px;
        font-family: var(--font-body);
        font-size: var(--text-body-2);
        cursor: pointer;
        white-space: nowrap;
        width: 100%;
        transition: none;
    }

    .header-category-btn img {
        display: none;
    }

    .header-category-btn:hover,
    .header-category-btn:focus {
        background-color: var(--color-primary) !important;
        color: var(--color-background) !important;
        opacity: 1;
    }


    /* --- Kategorije dropdown --- */

    .category-dropdown-menu {
        position: absolute;
        top: calc(100% + 12px);
        left: 0;
        width: 280px;
        background: var(--color-white);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        padding: 0.75rem 0;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-4px);
        transition: opacity 0.2s ease, transform 0.2s ease;
        z-index: 50;
    }

    /* Trikotnik */
    .category-dropdown-menu::before {
        content: '';
        position: absolute;
        top: -8px;
        left: 40px;
        width: 0;
        height: 0;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-bottom: 8px solid var(--color-white);
    }

    /* Neviden most med gumbom in menujem — prepreči izgubo hoverja */
    .category-dropdown-menu::after {
        content: '';
        position: absolute;
        top: -12px;
        left: 0;
        width: 100%;
        height: 12px;
    }

    .header-category-dropdown:hover .category-dropdown-menu,
    .header-category-dropdown:focus-within .category-dropdown-menu {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .category-dropdown-list {
        list-style: none;
        padding: 0.5rem 0;
        margin: 0;
    }

    .category-dropdown-list .menu-item-link {
        padding: 0.875rem 1.25rem;
        border-bottom: none;
        font-size: var(--text-small);
        color: var(--color-primary);
    }

    .category-dropdown-list .menu-item-link:hover {
        background-color: rgba(10, 71, 52, 0.04);
    }


    /* --- Desktop FiboSearch --- */

    .header-search-desktop .dgwt-wcas-search-form {
        height: 36px;
        box-sizing: border-box;
        padding: 0;
    }

    .header-search-desktop .dgwt-wcas-sf-wrapp {
        height: 36px;
        box-sizing: border-box;
        padding: 0;
        position: relative;
    }

    .header-search-desktop .dgwt-wcas-search-input {
        height: 36px !important;
        box-sizing: border-box;
        padding: 0 12px 0 40px !important;
        line-height: 36px;
    }

    .header-search-desktop .dgwt-wcas-search-submit {
        position: absolute;
        top: 50% !important;
        left: 8px !important;
        right: auto !important;
        transform: translateY(-50%);
        height: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        background: none;
        border: none;
        box-sizing: border-box;
    }

}