/* =========================================================
   HEADER
========================================================= */

.main-header {

    width: 100%;
    min-height: 66px;

    display: grid;

    /*
       Desktop structure:
       LOGO       NAVIGATION       AUTH BUTTONS
       LEFT          CENTER             RIGHT
    */
    grid-template-columns: 1fr auto 1fr;

    align-items: center;

    background-color: #dce7e8;

    padding: 10px 40px;

    box-sizing: border-box;

    /* =====================================================
       FIXED HEADER
       Header will always stay visible at the top
    ===================================================== */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999;
}


/* =========================================================
   LOGO
========================================================= */

.logo-link {

    display: flex;

    align-items: center;

    justify-content: flex-start;

    flex-shrink: 0;

    text-decoration: none;

    justify-self: start;
}


.logo {

    width: 125px;

    max-width: 100%;

    height: auto;

    display: block;
}


/* =========================================================
   NAVIGATION
========================================================= */

.main-nav {

    display: flex;

    align-items: center;

    justify-content: center;

    justify-self: center;
}


.menu {

    list-style: none;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-wrap: nowrap;

    margin: 0;

    padding: 0;

    gap: 22px;
}


.menu > li {

    position: relative;
}


.menu a {

    text-decoration: none;

    color: #183b4a;

    font-size: 19px;

    font-weight: 500;

    white-space: nowrap;

    transition:
        color 0.3s ease,
        background-color 0.3s ease;
}


.menu > li > a {

    display: block;

    padding: 10px 0;
}


/* =========================================================
   NAVIGATION HOVER
========================================================= */

.menu > li > a:hover {

    color: #2d7ef7;
}


/* =========================================================
   DROPDOWN MENU
========================================================= */

.submenu {

    display: none;

    list-style: none;

    position: absolute;

    top: 100%;

    left: 0;

    min-width: 190px;

    margin: 0;

    padding: 10px 0;

    background-color: #ffffff;

    border-radius: 6px;

    box-shadow:
        0 5px 18px rgba(0, 0, 0, 0.12);

    z-index: 9999;
}


/* =========================================================
   DESKTOP DROPDOWN
========================================================= */

.dropdown:hover > .submenu {

    display: block;
}


/* =========================================================
   DROPDOWN ARROW
   Hidden on desktop
========================================================= */

.dropdown-icon {

    display: none;

}


/* =========================================================
   DROPDOWN ITEMS
========================================================= */

.submenu li {

    display: block;

    width: 100%;

    margin: 0;

    padding: 0;
}


.submenu li a {

    display: block;

    width: 100%;

    box-sizing: border-box;

    padding: 11px 18px;

    color: #183b4a;

    font-size: 18px;

    text-decoration: none;

    transition:
        background-color 0.25s ease,
        color 0.25s ease;
}


/* Dropdown hover */

.submenu li a:hover {

    background-color: #eef5f6;

    color: #2d7ef7;
}


/* =========================================================
   AUTH BUTTONS
========================================================= */

.auth-buttons {

    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 10px;

    flex-shrink: 0;

    justify-self: end;
}


/* =========================================================
   COMMON BUTTON STYLING
========================================================= */

.signin-btn,
.signup-btn {

    display: inline-flex;

    justify-content: center;

    align-items: center;

    min-width: 92px;

    height: 38px;

    padding: 0 18px;

    border-radius: 6px;

    font-size: 14px;

    font-weight: 600;

    text-decoration: none;

    white-space: nowrap;

    box-sizing: border-box;

    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        transform 0.2s ease;
}


/* =========================================================
   SIGN IN
========================================================= */

.signin-btn {

    background-color: #ffffff;

    color: #2d7ef7;

    border: 1px solid #2d7ef7;
}


.signin-btn:hover {

    background-color: #2d7ef7;

    color: #ffffff;

    border-color: #2d7ef7;
}


/* =========================================================
   SIGN UP
========================================================= */

.signup-btn {

    background-color: #2d7ef7;

    color: #ffffff;

    border: 1px solid #2d7ef7;
}


.signup-btn:hover {

    background-color: #1d5fd0;

    border-color: #1d5fd0;

    color: #ffffff;
}


/* =========================================================
   CLICK EFFECT
========================================================= */

.signin-btn:active,
.signup-btn:active {

    transform: scale(0.97);
}


/* =========================================================
   ACCOUNT ICON
========================================================= */

.account-menu {

    position: relative;

    display: flex;

    align-items: center;
}


.account-icon-btn {

    width: 38px;

    height: 38px;

    padding: 0;

    border: 1px solid #2d7ef7;

    border-radius: 6px;

    background-color: #ffffff;

    color: #183b4a;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        transform 0.2s ease;
}


.account-icon-btn:hover {

    background-color: #2d7ef7;

    color: #ffffff;

    border-color: #2d7ef7;
}


.account-icon {

    font-size: 20px;

    line-height: 1;
}


.account-icon-btn:active {

    transform: scale(0.97);
}


/* =========================================================
   ACCOUNT DROPDOWN
========================================================= */

.account-dropdown {

    display: none;

    position: absolute;

    top: calc(100% + 10px);

    right: 0;

    min-width: 190px;

    padding: 8px 0;

    background-color: #ffffff;

    border-radius: 6px;

    box-shadow:
        0 5px 18px rgba(0, 0, 0, 0.15);

    border: 1px solid #e5eeee;

    z-index: 10000;
}


.account-dropdown.active {

    display: block;
}


.account-dropdown a {

    display: flex;

    align-items: center;

    gap: 10px;

    width: 100%;

    box-sizing: border-box;

    padding: 11px 16px;

    color: #183b4a;

    font-size: 15px;

    font-weight: 500;

    text-decoration: none;

    white-space: nowrap;

    transition:
        background-color 0.25s ease,
        color 0.25s ease;
}


.account-dropdown a:hover {

    background-color: #eef5f6;

    color: #2d7ef7;
}


.account-dropdown a span {

    width: 20px;

    text-align: center;

    font-size: 16px;
}


/* =========================================================
   CART ICON
========================================================= */

.cart-icon-btn {

    width: 38px;

    height: 38px;

    padding: 0;

    border: 1px solid #2d7ef7;

    border-radius: 6px;

    background-color: #ffffff;

    color: #183b4a;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    text-decoration: none;

    box-sizing: border-box;

    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        transform 0.2s ease;
}


.cart-icon-btn:hover {

    background-color: #2d7ef7;

    color: #ffffff;

    border-color: #2d7ef7;
}


.cart-icon {

    font-size: 20px;

    line-height: 1;
}


.cart-icon-btn:active {

    transform: scale(0.97);
}


/* =========================================================
   HAMBURGER BUTTON
========================================================= */

.menu-toggle {

    display: none;

    border: none;

    background: transparent;

    color: #183b4a;

    font-size: 28px;

    cursor: pointer;

    padding: 5px;

    line-height: 1;

    transition: color 0.3s ease;
}


.menu-toggle:hover {

    color: #2d7ef7;
}


/* =========================================================
   SEARCH
========================================================= */

.search-wrapper {

    position: relative;

    display: flex;

    align-items: center;
}


.search-icon-btn {

    width: 38px;

    height: 38px;

    padding: 0;

    border: 1px solid #2d7ef7;

    border-radius: 6px;

    background-color: #ffffff;

    color: #183b4a;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        transform 0.2s ease;
}


.search-icon-btn:hover {

    background-color: #2d7ef7;

    color: #ffffff;
}


.search-icon-btn:active {

    transform: scale(0.97);
}


.search-icon {

    font-size: 18px;

    line-height: 1;
}


/* =========================================================
   SEARCH BOX (expands when icon is clicked)
========================================================= */

.search-box {

    display: flex;

    align-items: center;

    overflow: hidden;

    max-width: 0;

    opacity: 0;

    padding: 0;

    margin: 0;

    position: absolute;

    top: calc(100% + 10px);

    right: 0;

    background-color: #ffffff;

    border: 1px solid #e5eeee;

    border-radius: 6px;

    box-shadow:
        0 5px 18px rgba(0, 0, 0, 0.15);

    z-index: 10000;

    transition:
        max-width 0.35s ease,
        opacity 0.25s ease;
}


.search-box.active {

    max-width: 280px;

    opacity: 1;

    padding: 4px;
}


.search-box input {

    border: none;

    outline: none;

    padding: 8px 10px;

    font-size: 14px;

    width: 220px;

    color: #183b4a;

    background: transparent;
}


.search-submit-btn {

    border: none;

    background: transparent;

    color: #2d7ef7;

    font-size: 18px;

    cursor: pointer;

    padding: 0 10px;

    flex-shrink: 0;
}


.search-submit-btn:hover {

    color: #1d5fd0;
}


/* =========================================================
   SEARCH SUGGESTIONS (live dropdown while typing)
========================================================= */

.search-suggestions {

    display: none;

    position: absolute;

    /* Positioned below the search input box (not on top of it) so the
       input stays visible and typeable while suggestions are showing. */
    top: calc(100% + 54px);

    right: 0;

    width: 320px;

    max-height: 400px;

    overflow-y: auto;

    background-color: #ffffff;

    border: 1px solid #e5eeee;

    border-radius: 6px;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.18);

    z-index: 10001;
}


.search-suggestions.active {

    display: block;
}


.search-suggestion-item {

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 10px 12px;

    text-decoration: none;

    color: #183b4a;

    border-bottom: 1px solid #f0f4f4;

    transition: background-color 0.2s ease;
}


.search-suggestion-item:last-of-type {

    border-bottom: none;
}


.search-suggestion-item:hover {

    background-color: #eef5f6;
}


.search-suggestion-img {

    width: 44px;

    height: 44px;

    object-fit: cover;

    border-radius: 4px;

    flex-shrink: 0;

    background-color: #f0f4f4;
}


.search-suggestion-text {

    display: flex;

    flex-direction: column;

    gap: 2px;

    min-width: 0;
}


.search-suggestion-title {

    font-size: 14px;

    font-weight: 500;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


.search-suggestion-sku {

    font-size: 12px;

    color: #7a8a90;
}


.search-suggestion-empty {

    padding: 14px 12px;

    font-size: 14px;

    color: #7a8a90;

    text-align: center;
}


.search-suggestion-viewall {

    display: block;

    padding: 12px;

    text-align: center;

    font-size: 14px;

    font-weight: 600;

    color: #2d7ef7;

    text-decoration: none;

    background-color: #f7fafa;
}


.search-suggestion-viewall:hover {

    background-color: #eef5f6;
}


@media (max-width: 850px) {

    .search-suggestions.active {

        position: fixed;

        top: 125px;

        left: 15px;

        right: 15px;

        width: auto;
    }

}


/* =========================================================
   DESKTOP - LARGE SCREEN
   1200px and above
========================================================= */

@media (min-width: 1200px) {

    .main-header {

        padding-left: 40px;

        padding-right: 40px;
    }


    .logo {

        width: 125px;

    }


    .menu {

        gap: 24px;

    }


    .menu a {

        font-size: 19px;

    }

}


/* =========================================================
   DESKTOP / SMALL LAPTOP
   1101px - 1199px
========================================================= */

@media (min-width: 1101px) and (max-width: 1199px) {

    .main-header {

        padding-left: 25px;

        padding-right: 25px;
    }


    .logo {

        width: 115px;

    }


    .menu {

        gap: 16px;

    }


    .menu a {

        font-size: 17px;

    }


    .signin-btn,
    .signup-btn {

        min-width: 82px;

        height: 37px;

        padding: 0 13px;

        font-size: 13px;

    }


    .account-icon-btn,
    .cart-icon-btn {

        width: 37px;

        height: 37px;

    }

}


/* =========================================================
   TABLET
   iPad / Surface / Similar Devices
========================================================= */

@media (max-width: 1100px) {

    .main-header {

        padding: 10px 25px;

    }

}


/* =========================================================
   SMALL TABLET / MOBILE
   <= 850px
========================================================= */

@media (max-width: 850px) {

    .main-header {

        min-height: 62px;

        display: flex;

        flex-wrap: wrap;

        padding: 9px 20px;

        row-gap: 10px;

    }


    /* =====================================================
       LOGO
    ===================================================== */

    .logo-link {

        justify-self: auto;

    }


    .logo {

        width: 105px;

    }


    /* =====================================================
       HAMBURGER
    ===================================================== */

    .menu-toggle {

        display: block;

        margin-left: auto;

        margin-right: 15px;

    }


    /* =====================================================
       MOBILE NAVIGATION
    ===================================================== */

    .main-nav {

        display: none;

        position: absolute;

        top: 100%;

        left: 0;

        right: 0;

        width: 100%;

        background-color: #ffffff;

        box-shadow:
            0 8px 20px rgba(0, 0, 0, 0.10);

    }


    /* Open main hamburger menu */

    .main-nav.active {

        display: block;

    }


    /* =====================================================
       MOBILE MENU
    ===================================================== */

    .menu {

        display: flex;

        flex-direction: column;

        align-items: stretch;

        gap: 0;

        width: 100%;

    }


    .menu > li {

        width: 100%;

    }


    .menu > li > a {

        padding: 14px 25px;

        border-bottom: 1px solid #e5eeee;

        font-size: 18px;

    }


    /* =====================================================
       MOBILE DROPDOWN
    ===================================================== */

    .dropdown > .submenu {

        display: none;

        position: static;

        width: 100%;

        min-width: 0;

        margin: 0;

        padding: 0;

        box-shadow: none;

        border-radius: 0;

        background-color: #f7fafa;

    }


    /* Show submenu when JavaScript adds .open */

    .dropdown.open > .submenu {

        display: block;

    }


    /* =====================================================
       MOBILE DROPDOWN LINK
    ===================================================== */

    .dropdown-toggle {

        display: flex !important;

        align-items: center;

        justify-content: space-between;

        width: 100%;

        box-sizing: border-box;

    }


    /* =====================================================
       MOBILE DROPDOWN ARROW
    ===================================================== */

    .dropdown-icon {

        display: inline-block;

        margin-left: 8px;

        font-size: 18px;

        line-height: 1;

        transition:
            transform 0.3s ease;

    }


    /* Rotate arrow when submenu is open */

    .dropdown.open .dropdown-icon {

        transform: rotate(180deg);

    }


    /* =====================================================
       SUBMENU ITEMS
    ===================================================== */

    .submenu li a {

        padding: 12px 40px;

        font-size: 16px;

        border-bottom: 1px solid #e5eeee;

    }


    /* =====================================================
       DISABLE DESKTOP HOVER ON MOBILE
    ===================================================== */

    .dropdown:hover > .submenu {

        display: none;

    }


    /* =====================================================
       KEEP CLICKED DROPDOWN OPEN
    ===================================================== */

    .dropdown.open:hover > .submenu {

        display: block;

    }


    /* =====================================================
       AUTH
    ===================================================== */

    .auth-buttons {

        gap: 7px;

        justify-self: auto;

    }


    .signin-btn,
    .signup-btn {

        min-width: 78px;

        height: 37px;

        padding: 0 12px;

        font-size: 13px;

    }


    .account-icon-btn,
    .cart-icon-btn {

        width: 37px;

        height: 37px;

        border-radius: 5px;

    }


    .account-icon,
    .cart-icon {

        font-size: 18px;

    }


    .account-dropdown {

        top: calc(100% + 8px);

        min-width: 180px;

    }


    /* =====================================================
       SEARCH (mobile)
       Full-width dropdown instead of small floating box.
    ===================================================== */

    .search-box.active {

        position: fixed;

        top: 70px;

        left: 0;

        right: 0;

        max-width: 100%;

        border-radius: 0;

        padding: 10px 15px;
    }

    .search-box input {

        width: 100%;
    }


}


/* =========================================================
   MOBILE
   <= 600px
========================================================= */

@media (max-width: 600px) {

    .main-header {

        min-height: 58px;

        padding: 8px 15px;

    }


    .logo {

        width: 95px;

    }


    /* Hamburger */

    .menu-toggle {

        font-size: 25px;

        margin-right: 8px;

    }


    /* Auth buttons */

    .auth-buttons {

        gap: 6px;

    }


    .signin-btn,
    .signup-btn {

        min-width: 70px;

        height: 35px;

        padding: 0 10px;

        border-radius: 5px;

        font-size: 12px;

    }


    .account-icon-btn,
    .cart-icon-btn {

        width: 35px;

        height: 35px;

        border-radius: 5px;

    }


    .account-icon,
    .cart-icon {

        font-size: 17px;

    }


    /* Search (small mobile) */

    .search-box.active {

        top: 65px;
    }

    .search-icon-btn {

        width: 35px;

        height: 35px;
    }

    .search-icon {

        font-size: 16px;
    }


}


/* =========================================================
   VERY SMALL MOBILE
   <= 400px
========================================================= */

@media (max-width: 400px) {

    .main-header {

        padding: 8px 12px;

    }


    .logo {

        width: 85px;

    }


    .menu-toggle {

        font-size: 23px;

        margin-right: 5px;

    }


    .auth-buttons {

        gap: 5px;

    }


    .signin-btn,
    .signup-btn {

        min-width: 64px;

        height: 32px;

        padding: 0 8px;

        font-size: 11px;

    }


    .account-icon-btn,
    .cart-icon-btn {

        width: 32px;

        height: 32px;

        border-radius: 5px;

    }


    .account-icon,
    .cart-icon {

        font-size: 15px;

    }


    .account-dropdown {

        right: 0;

        min-width: 175px;

    }

}


html,
body {
    margin: 0;
    padding: 0;
}

body {
    padding-top: 88px;
}