/**
 * Header Component
 *
 * @package amed-theme
 */

/* ========================================
   Site Header
======================================== */

.site-header {
    position: relative;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
}

.site-header .navbar {
    min-height: 88px;
    padding: 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    min-height: 88px;
}

/* ========================================
   Branding
======================================== */

.site-header__branding {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    text-decoration: none;
}

.navbar-brand img {
    display: block;
    width: auto;
    height: auto;
    max-height: 72px;
    object-fit: contain;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #212529;
}

/* ========================================
   Navigation
======================================== */

.navbar-collapse {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.navbar-nav > li {
    list-style: none;
}

.navbar-nav .nav-item {
    position: relative;
}

.navbar-nav .nav-link {
    display: flex;
    align-items: center;
    height: 88px;
    padding: 0 1rem;
    color: #212529;
    font-weight: 500;
    text-decoration: none;
    transition: color .2s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active {
    color: #0d6efd;
}

/* ========================================
   Dropdown (Desktop)
======================================== */

@media (min-width: 992px) {

    .navbar-nav .dropdown-menu {
        left: 50%;
        transform: translateX(-50%);
        margin-top: .25rem;
        min-width: 200px;
        padding: .5rem 0;
        border-radius: .5rem;
    }

}

/* ========================================
   Language Switcher
======================================== */

.site-header__language-switcher {
    display: flex;
    align-items: center;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid #e5e5e5;
}

.language-switcher {
    display: flex;
    align-items: center;
}

.language-switcher__list {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.language-switcher__item {
    margin: 0;
    padding: 0;
    list-style: none;
}

.language-switcher__link {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 40px;
    height: 40px;

    padding: 0 .75rem;

    color: #212529;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;

    border: 1px solid transparent;
    border-radius: 9999px;

    transition: all .2s ease;
}

.language-switcher__link:hover,
.language-switcher__link:focus {
    color: #0d6efd;
    border-color: #0d6efd;
}

.language-switcher__link.is-active {
    color: #fff;
    background: #0d6efd;
    border-color: #0d6efd;
}

.language-switcher__label {
    line-height: 1;
    letter-spacing: .05em;
}

/* ========================================
   Navbar Toggler
======================================== */

.navbar-toggler {
    border: 1px solid #dee2e6;
    padding: .5rem .75rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}


/* ========================================
   Sticky Smart Header
======================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    transition:
        min-height 0.3s ease,
        box-shadow 0.3s ease,
        background-color 0.3s ease;
}

.site-header.is-sticky {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.site-header.is-sticky .navbar,
.site-header.is-sticky .container {
    min-height: 72px;
}

.site-header.is-sticky .navbar-nav .nav-link {
    height: 72px;
}

.site-header.is-sticky .navbar-brand img {
    max-height: 60px;
}

/* ========================================
   Responsive
======================================== */

@media (max-width: 991.98px) {

    .site-header .navbar,
    .site-header .container {
        min-height: 72px;
    }

    .navbar-brand img {
        max-height: 60px;
    }

    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;

        display: none;
        flex-direction: column;
        align-items: stretch;

        padding: 1rem;

        background: #fff;
        border-top: 1px solid #e5e5e5;
        box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .1);

        z-index: 999;
    }

    .navbar-collapse.show {
        display: flex;
    }

    .navbar-nav {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0;
    }

    .navbar-nav > li {
        width: 100%;
    }

    .navbar-nav .nav-link {
        width: 100%;
        height: auto;
        padding: .75rem 0;
        text-align: left;
    }

    .navbar-nav .dropdown-menu {
        position: static;

        left: auto;
        right: auto;
        transform: none;

        width: 100%;
        min-width: 0;

        margin: .25rem 0 .75rem;
        padding: 0 0 0 1rem;

        border: 0;
        border-radius: 0;

        box-shadow: none;
        background: transparent;
    }

    .site-header__language-switcher {
        width: 100%;
        margin: 1rem 0 0;
    }

    .language-switcher__list {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }

    .language-switcher__link {
        justify-content: flex-start;
        min-width: auto;
        height: auto;
        padding: .5rem 0;
        border: 0;
        border-radius: 0;
    }

    .language-switcher__link.is-active {
        background: transparent;
        color: #0d6efd;
    }

    .header-actions {
    width: 100%;
    margin: 1rem 0 0;
    flex-wrap: wrap;
    }

    .header-search,
    .header-cta {
        margin: 0;
    }
}

@media (max-width: 575.98px) {

    .site-header .navbar,
    .site-header .container {
        min-height: 64px;
    }

    .navbar-brand img {
        max-height: 52px;
    }

    .site-title {
        font-size: 1.25rem;
    }

    .navbar-toggler {
        padding: .375rem .625rem;
    }
  
}

/* ========================================
   Header Actions
======================================== */

    .header-actions {
        display: flex;
        align-items: center;
        gap: .75rem;
        margin-left: 1.5rem;
    }

    .header-search {
        display: flex;
        align-items: center;
    }

    .header-search__button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        background: transparent;
        border: 1px solid #dee2e6;
        border-radius: 9999px;
        cursor: pointer;
        transition: all .2s ease;
    }

    .header-search__button:hover,
    .header-search__button:focus {
        color: #0d6efd;
        border-color: #0d6efd;
    }

    .header-cta {
        display: flex;
        align-items: center;
    }

    .header-cta__link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0 1.5rem;
        text-decoration: none;
        border-radius: 9999px;
        background: #0d6efd;
        color: #fff;
        transition: all .2s ease;
    }

    .header-cta__link:hover,
    .header-cta__link:focus {
        background: #0b5ed7;
        color: #fff;
    }

    .header-search {
        position: relative;
        display: flex;
        align-items: center;
    }

    .header-search__button {
        background: none;
        border: 0;
        cursor: pointer;
        font-size: 1rem;
    }

    .header-search__form {
	position: absolute;
	top: calc(100% + 12px);
	right: 0;
	display: none;
	width: 320px;
	padding: 1rem;
	background: #fff;
	border: 1px solid #dee2e6;
	border-radius: .5rem;
	box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
	z-index: 1000;
    }

    .header-search__form.is-active {
        display: block;
    }

    .header-search__form .search-form {
        display: flex;
        gap: .5rem;
        align-items: center;
    }

    .header-search__form .search-field {
        flex: 1;
        padding: .625rem .75rem;
        border: 1px solid #ced4da;
        border-radius: .375rem;
    }

    .header-search__form button[type="submit"] {
        padding: .625rem 1rem;
        border: 0;
        border-radius: .375rem;
        background: #0d6efd;
        color: #fff;
        cursor: pointer;
    }

    .header-search__form button[type="submit"]:hover {
        background: #0b5ed7;
    }

    @media (max-width: 991.98px) {

        .header-search {
            width: 100%;
            padding: 0 1rem;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
        }

        .header-search__button {
            margin-bottom: .75rem;
        }

        .header-search__form {
            position: static;
            width: 100%;
            min-width: 0;
            margin-top: 1rem;
            padding: 0;
            border: 0;
            border-radius: 0;
            box-shadow: none;
            background: transparent;
        }

        .header-search__form .search-form {
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: .75rem;
        }

        .header-search__form .search-field {
            width: 100%;
            box-sizing: border-box;
        }

        .header-search__form button[type="submit"] {
            width: 100%;
        }

    }