/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1299.98px) {

    .topBarMenu {
        gap: 22px;
    }

    .headerInner {
        grid-template-columns:
            225px 205px minmax(280px, 1fr) auto;
        gap: 16px;
    }

    .headerLogo img {
        max-width: 195px;
    }

    .headerRight {
        gap: 9px;
    }
}


/* =========================================================
   TABLET / MOBILE TOP MENU
========================================================= */

@media (max-width: 1199.98px) {

    /* =========================
       HEADER
    ========================= */

    .headerInner {
        grid-template-columns:
            180px 48px minmax(250px, 1fr) auto;
        gap: 14px;
    }

    .headerLogo img {
        max-width: 165px;
    }



    .categoryBtnText {
        display: none;
    }

    .headerItem .content {
        display: none;
    }


    /* =========================
       TOP BAR
    ========================= */

    .topBarInner {
        grid-template-columns: 1fr auto;
        gap: 12px;
    }

    .topBarMenuToggle {
        justify-self: end;
        display: inline-flex;
    }

    .topBarRight {
        display: none;
    }


    /* =========================
       MAIN MOBILE MENU
    ========================= */

    .topBarMenu {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        z-index: 1200;

        width: 100%;
        height: auto;
        max-height: 0;
        margin: 0;
        padding: 0 20px;

        display: block;

        overflow: hidden;
        visibility: hidden;
        opacity: 0;

        border-top: 1px solid transparent;
        background: #fff;
        box-shadow: 0 15px 35px rgba(18, 39, 42, 0.12);

        /* transition: max-height 0.45s ease, padding 0.35s ease, opacity 0.3s ease, visibility 0.3s ease, border-color 0.3s ease; */
    }

    .topBarMenu.mobileMenuOpen {
        max-height: calc(100vh - 44px);
        padding: 12px 20px 20px;

        overflow-y: auto;
        visibility: visible;
        opacity: 1;

        border-top-color: var(--border);
    }

    .topBarMenu>li {
        position: relative;
        width: 100%;
        height: auto;

        display: block;

        border-bottom: 1px solid var(--border);
    }

    .topBarMenu>li:last-child {
        border-bottom: 0;
    }


    /* =========================
       NORMAL MENU LINKS
    ========================= */

    .topBarMenu>li:not(.topHasDropdown)>a {
        width: 100%;
        height: normal;
        padding: 8px 15px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        font-size: 14px;
        line-height: 1.4;
        white-space: normal;
    }

    .topBarMenu>li>a::after {
        display: none;
    }


    /* =========================
       DROPDOWN PARENT
    ========================= */

    .topBarMenu>li.topHasDropdown {
        position: relative;

        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 48px;
        align-items: center;

        width: 100%;
    }

    .topBarMenu>li.topHasDropdown>a {
        grid-column: 1;
        width: 100%;
        padding: 8px 15px;
        display: flex;
        align-items: center;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.4;
        text-decoration: none;
        white-space: normal;
    }


    /* =========================
       GENERATED ARROW BUTTON
    ========================= */

    .topBarMenu>li.topHasDropdown>.topSubMenuToggle {
        grid-column: 2;

        width: 48px;
        height: auto;
        padding: 0;

        border: 0;
        /* border-left: 1px solid var(--border); */

        color: var(--dark);
        background: transparent;

        display: flex;
        align-items: center;
        justify-content: center;

        cursor: pointer;
    }

    .topSubMenuToggle svg {
        width: 13px;
        height: 13px;

        pointer-events: none;

        transition: transform var(--transition);
    }

    .topSubMenuToggle:hover,
    .topSubMenuToggle:focus {
        color: var(--primary);
        background: rgba(0, 143, 135, 0.06);
    }


    /* Desktop hover rotation reset on mobile */

    .topHasDropdown:hover>.topSubMenuToggle svg,

    .topHasDropdown:focus-within>.topSubMenuToggle svg {
        transform: none;
    }


    /* Open dropdown state */

    .topHasDropdown.submenuOpen>a,
    .topHasDropdown.submenuOpen>.topSubMenuToggle {
        color: var(--primary);
    }

    .topHasDropdown.submenuOpen>.topSubMenuToggle svg {
        transform: rotate(180deg);
    }


    /* =========================
       MOBILE SUBMENU RESET
    ========================= */

    .topBarMenu>li.topHasDropdown>.topSubMenu {
        grid-column: 1 / -1;

        position: static !important;

        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;

        height: auto;
        max-height: 0;

        margin: 0 !important;
        padding: 0 !important;

        display: block !important;

        overflow: hidden;
        visibility: hidden;
        opacity: 0;

        background: #f7f9f8 !important;

        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;

        transform: none !important;

        transition:
            max-height 0.4s ease,
            padding 0.3s ease,
            opacity 0.3s ease,
            visibility 0.3s ease;
    }

    .topBarMenu>li.topHasDropdown.submenuOpen>.topSubMenu {
        max-height: 500px;

        padding: 0 !important;

        visibility: visible;
        opacity: 1;
    }


    /* =========================
       SUBMENU ITEMS
    ========================= */

    .topBarMenu>li.topHasDropdown>.topSubMenu>li {
        width: 100% !important;
        height: auto;

        margin: 0;
        padding: 0;

        display: block;

        border: 0 !important;
        background: transparent !important;
    }

    .topBarMenu>li.topHasDropdown>.topSubMenu>li>a {
        width: 100%;
        min-height: auto;
        padding: 6px 15px;
        border-radius: 0;
        border-bottom: 1px solid #eee;
        color: var(--text);
        background: transparent !important;
        display: flex;
        align-items: center;
        font-size: 13px;
        font-weight: 500;
        text-decoration: none;
        transition: color var(--transition), background-color var(--transition), padding-left var(--transition);
    }

    .topBarMenu>li.topHasDropdown>.topSubMenu>li>a:hover,

    .topBarMenu>li.topHasDropdown>.topSubMenu>li>a:focus {
        padding-left: 17px;
        color: var(--primary);
        background: rgba(0, 143, 135, 0.08) !important;
    }
}


/* =========================================================
   MOBILE / OFF-CANVAS READY
========================================================= */

@media (max-width: 991.98px) {

    .header {
        padding-top: 10px;
    }

    .headerInner {
        min-height: 72px;
        grid-template-columns:
            minmax(135px, 1fr) auto;
        gap: 12px;
    }

    .headerLogo {
        grid-column: 1;
        grid-row: 1;
    }

    .headerLogo img {
        max-width: 155px;
        max-height: 56px;
    }

    .categoryMenu {
        grid-column: 2;
        grid-row: 1;
        order: 2;
        display: none;
    }

    .headerRight {
        grid-column: 2;
        grid-row: 1;
    }

    .categoryDropdown {
        position: fixed;
        top: 90px;
        right: 12px;
        left: 12px;

        width: auto;
        max-height: calc(100vh - 90px);

        overflow-y: auto;
    }

    .headerSearch {
        grid-column: 1 / -1;
        grid-row: 2;
        padding-bottom: 10px;
    }

    .headerSearch form {
        height: 44px;
    }

    .headerItem .icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 575.98px) {

    .headerInner {
        grid-template-columns:
            minmax(110px, 1fr) auto;
        gap: 8px;
    }

    .headerLogo img {
        max-width: 140px;
    }

    .headerRight {
        gap: 6px;
    }


    .headerItem .icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .headerItem .icon svg {
        width: 18px;
        height: 18px;
    }

    .headerItem .count {
        top: -5px;
        right: -4px;

        min-width: 18px;
        height: 18px;

        font-size: 8px;
    }

    .headerSearch input {
        padding-right: 50px;
        padding-left: 14px;
        font-size: 12px;
    }

    .headerSearch button {
        width: 34px;
        height: 34px;
    }


    /* Top bar */

    .topBar {
        min-height: 42px;
    }

    .topBarInner {
        min-height: 41px;
    }

    .topBarLeft a {
        font-size: 14px;
    }

    .topBarLeft a svg {
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
    }

    .topBarMenuToggle {
        width: 34px;
        height: 34px;
    }

    .topBarMenuToggle span {
        width: 20px;
    }

    .topBarMenu {
        padding-right: 15px;
        padding-left: 15px;
    }

    .topBarMenu.mobileMenuOpen {
        padding: 0;
    }

    .topBarMenu>li.topHasDropdown {
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    .topBarMenu>li.topHasDropdown>.topSubMenuToggle {
        width: 44px;
    }
}