/* ==========================================================
   FM Collections
   Desktop Header
========================================================== */

/* ==========================================================
   Header Layout
========================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid #e5ebe6;
    box-shadow: 0 8px 28px rgba(31, 41, 55, 0.045);
    backdrop-filter: blur(12px);
}

.header-container {
    width: 100%;
    max-width: 1320px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================
   Logo
========================================================== */

.header-logo {
    flex: 0 0 auto;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
}

.logo-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    border: 1px solid rgba(46, 125, 50, 0.15);
    border-radius: 50%;
    background:
        linear-gradient(
            145deg,
            #2e7d32,
            #388e3c
        );
    color: #ffffff;
    font-size: 17px;
    font-weight: 850;
    letter-spacing: 0.02em;
    box-shadow:
        0 10px 22px rgba(46, 125, 50, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition:
        transform 0.28s ease,
        box-shadow 0.28s ease;
}

.logo-text {
    color: #182331;
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
    white-space: nowrap;
    transition: color 0.25s ease;
}

.logo:hover .logo-icon {
    transform: rotate(-6deg) scale(1.04);
    box-shadow:
        0 13px 26px rgba(46, 125, 50, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.logo:hover .logo-text {
    color: #2e7d32;
}

/* ==========================================================
   Desktop Navigation
========================================================== */

.header-nav {
    min-width: 0;
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-nav ul {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 31px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.header-nav li {
    position: relative;
}

.header-nav > ul > li > a {
    position: relative;
    height: 78px;
    display: inline-flex;
    align-items: center;
    color: #263142;
    font-size: 14px;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    transition: color 0.25s ease;
}

.header-nav > ul > li > a::after {
    position: absolute;
    right: 0;
    bottom: 17px;
    left: 0;
    width: 0;
    height: 3px;
    margin: auto;
    border-radius: 999px;
    background: #2e7d32;
    content: "";
    transition: width 0.25s ease;
}

.header-nav > ul > li > a:hover,
.header-nav > ul > li > a.active {
    color: #2e7d32;
}

.header-nav > ul > li > a:hover::after,
.header-nav > ul > li > a.active::after {
    width: 100%;
}

/* Dropdown Toggle */

.dropdown-toggle {
    gap: 6px;
    cursor: pointer;
}

/* ==========================================================
   Header Right
========================================================== */

.header-right {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

/* ==========================================================
   Search
========================================================== */

.search-wrapper {
    position: relative;
    min-width: 0;
}

.header-search {
    width: 300px;
    height: 46px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid #dfe6e1;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: inset 0 1px 2px rgba(31, 41, 55, 0.025);
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}

.header-search:focus-within {
    border-color: rgba(46, 125, 50, 0.55);
    background: #ffffff;
    box-shadow:
        0 0 0 4px rgba(46, 125, 50, 0.08),
        0 8px 22px rgba(46, 125, 50, 0.06);
}

.search-btn {
    width: 48px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #263142;
    font-size: 18px;
    cursor: pointer;
    transition:
        color 0.25s ease,
        transform 0.25s ease;
}

.search-btn:hover {
    color: #2e7d32;
    transform: scale(1.06);
}

.header-search input {
    min-width: 0;
    height: 100%;
    flex: 1;
    padding: 0 17px 0 2px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1f2937;
    font-size: 13px;
    font-weight: 500;
}

.header-search input::placeholder {
    color: #8c98a8;
    opacity: 1;
}

/* ==========================================================
   Action Icons
========================================================== */

.header-icon {
    position: relative;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    border: 1px solid #dfe6e1;
    border-radius: 50%;
    background: #ffffff;
    color: #263142;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 7px 18px rgba(31, 41, 55, 0.035);
    transition:
        color 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.header-icon:hover {
    border-color: rgba(46, 125, 50, 0.45);
    background: #eef7ef;
    color: #2e7d32;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(46, 125, 50, 0.12);
}

/* ==========================================================
   Header Badges
========================================================== */

.header-badge {
    position: absolute;
    top: -5px;
    right: -3px;
    min-width: 19px;
    height: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #2e7d32;
    color: #ffffff;
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    box-shadow: 0 5px 12px rgba(46, 125, 50, 0.22);
}

/* ==========================================================
   Login Button
========================================================== */

.login-btn {
    min-width: 82px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    border: 1px solid #2e7d32;
    border-radius: 999px;
    background:
        linear-gradient(
            135deg,
            #2e7d32,
            #34883a
        );
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(46, 125, 50, 0.17);
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.login-btn:hover {
    border-color: #256b29;
    background:
        linear-gradient(
            135deg,
            #256b29,
            #2e7d32
        );
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(46, 125, 50, 0.23);
}

/* ==========================================================
   Live Search Results
========================================================== */

.live-search-results {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    z-index: 1100;
    width: 100%;
    max-height: 420px;
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #dfe6e1;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 22px 50px rgba(31, 41, 55, 0.16);
}

.live-search-results.show {
    display: block;
}

.live-search-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    border-bottom: 1px solid #edf1ee;
    color: inherit;
    text-decoration: none;
    transition: background 0.22s ease;
}

.live-search-item:last-child {
    border-bottom: 0;
}

.live-search-item:hover {
    background: #f3f8f4;
}

.live-search-item img {
    width: 56px;
    height: 56px;
    display: block;
    flex: 0 0 56px;
    object-fit: contain;
    border: 1px solid #edf1ee;
    border-radius: 11px;
    background: #f8faf8;
}

.live-search-item div {
    min-width: 0;
    flex: 1;
}

.live-search-item strong {
    display: -webkit-box;
    margin-bottom: 4px;
    overflow: hidden;
    color: #1f2937;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.live-search-item span {
    color: #2e7d32;
    font-size: 12px;
    font-weight: 800;
}

/* ==========================================================
   Dropdown Menus
========================================================== */

.has-dropdown {
    position: relative;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: -16px;
    z-index: 999;
    width: 285px;
    margin-top: 0;
    padding: 10px;
    border: 1px solid #dfe6e1;
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.99);
    box-shadow: 0 20px 48px rgba(31, 41, 55, 0.13);
    opacity: 0;
    visibility: hidden;
    transform: translateY(9px);
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
}

.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Column */

.dropdown-column {
    position: relative;
}

.dropdown-title {
    min-height: 43px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 13px;
    border-radius: 10px;
    color: #263142;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.4;
    text-decoration: none;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        padding-left 0.2s ease;
}

.dropdown-title:hover {
    padding-left: 17px;
    background: #edf7ee;
    color: #2e7d32;
}

/* ==========================================================
   Flyout Submenu
========================================================== */

.has-submenu {
    position: relative;
}

.submenu {
    position: absolute;
    top: -10px;
    left: calc(100% + 8px);
    z-index: 1000;
    width: 255px;
    padding: 10px;
    border: 1px solid #dfe6e1;
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.99);
    box-shadow: 0 20px 48px rgba(31, 41, 55, 0.13);
    opacity: 0;
    visibility: hidden;
    transform: translateX(9px);
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
}

.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.submenu a {
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 0 13px;
    border-radius: 9px;
    color: #536171;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        padding-left 0.2s ease;
}

.submenu a:hover {
    padding-left: 17px;
    background: #edf7ee;
    color: #2e7d32;
}

/* ==========================================================
   Medium Desktop
========================================================== */

@media (max-width: 1180px) {
    .header-container {
        gap: 20px;
        padding: 0 20px;
    }

    .header-nav ul {
        gap: 23px;
    }

    .header-search {
        width: 245px;
    }

    .header-right {
        gap: 9px;
    }

    .login-btn {
        min-width: 74px;
        padding: 0 18px;
    }
}

/* ==========================================================
   Hide Desktop Header
========================================================== */

@media (max-width: 992px) {
    .site-header {
        display: none;
    }
}

/* ==========================================================
   Reduced Motion
========================================================== */

@media (prefers-reduced-motion: reduce) {
    .logo-icon,
    .logo-text,
    .header-nav > ul > li > a,
    .header-nav > ul > li > a::after,
    .search-btn,
    .header-icon,
    .login-btn,
    .dropdown,
    .dropdown-title,
    .submenu,
    .submenu a {
        transition: none;
    }
}