@media (max-width: 319px) {
    .page-header {
        width: 319px;
        transform-origin: top left;
        overflow: hidden;
        transform: scale(calc(100vw / 319px)); /* stylelint-disable-line */
    }
}

@media only screen and (max-width: 359px) {
    .page-header.type2 .logo {
        max-width: 61.5% !important;
    }

    .custom-block {
        top: 73px !important;
        right: 280px !important;
    }

    .page-header.type2 .minicart-wrapper {
        top: 41px !important;
        margin-right: 10px;
    }

    .block-search input {
        margin: 20px 0 !important
    }
}

@media (min-width: 360px) and (max-width: 767px) {
    .block-search input {
        margin: 0 0 20px 0 !important
    }
    .page-header.type2 .logo {
        max-width: 51.5% !important;
    }

    .custom-block {
        top: 38px !important;
        right: 115px !important;
    }

    .page-header.type2 .minicart-wrapper {
        margin-top: 13px !important;
    }
}

@media (min-width: 768px) and (max-width: 768px) {
    .block-search input {
        margin: 0 !important;
        height: 40px !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    /* Adjust the position of search field in tablet view */
    header .block-search {
        padding-left: 0 !important;
        padding-right: 30px;
    }

    .page-header.type2 .block-search .action.search {
        padding: 0 25px 0 15px !important;
        margin-right: 20px;
    }

    .block-search {
        margin-top: 15px;
        margin-bottom: 10px;
    }
}


@media (max-width: 991px) {
    /* Turn off display cart text in tablet and mobile view */
    header .header-cart-text {
        display: none;
    }

    /* Adjust the position of search field in tablet view */
    header #search {
        left: 0;
    }
    #search_mini_form .field.search .control {
        margin:0;
    }
    .block.block-search #search {
        position: relative;
    }
    .block.block-search {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .searchsuite-autocomplete {
        top: 125px;
        margin: 0 15px;
        right: 0;
        width: auto;
    }
    .searchsuite-autocomplete > div:first-child {
        box-shadow: 0 7px 15px #777;
    }
}

@media only screen and (min-width: 992px) {
    /* Adjust the navigation elements to the width of the bar */
    .nav-sections-item-content > .navigation > ul {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    /* Prevent scroll jumping on keyboard arrow scroll */
    .page-header {
        overflow-anchor: none;
    }

    /* Sticky page-header */
    header.page-header.sticky {
        position: sticky;
        left: 0;
        top: 0;
        z-index: 200;
        padding: 0;
        margin: 0;
        width: 100%;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        pointer-events: all;
        transition: box-shadow 0.3s ease;
    }

    /* Shadow for sticky header */
    .page-header.header-shadow {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    /* Adjusting padding to match the new way of displaying the sticky product in the product view — according to the updated function in head.html, the sticky product bar appears when the sticky header disappears */
    .sticky-product {
        padding-top: 15px !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    /* Header smaller after scrolling */
    .page-header .logo img {
        transform: scale(1);
        transition: transform 0.3s ease, max-height 0.3s ease;
    }

    .page-header a.logo {
        transition: none !important;
    }

    .page-header.is-scrolled .logo {
        margin: 10px 0 0 0;
    }

    .page-header.is-scrolled .navigation {
        font-size: 12px !important;
    }

    .page-header.is-scrolled .navigation a.level-top {
        height: 30px;
    }

    .page-header.is-scrolled .nav-sections-item-content > .navigation > ul > li > a {
        display: flex;
        align-items: center;
    }

    .page-header.is-scrolled .logo img {
        max-width: 360px;
        transform: scale(0.8);
    }

    .page-header.is-scrolled .panel.header {
        padding: 10px 15px 0 15px !important;
        height: 33px;
        font-size: 10px;
    }

    header .block-search {
        position: absolute;
        padding-left: 0 !important;
        top: 32px;
    }
}

@media (min-width: 1200px) {
    /* Change of page display width and padding on screens with a resolution above 1200px */
    .navigation, .page-wrapper > .breadcrumbs, .page-header .header.panel, .header.content, .footer.content, .page-wrapper > .widget, .page-wrapper > .page-bottom, .block.category.event, .top-container, .page-main, .checkout-cart-index .page-main
    {
        max-width: 1320px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .container {
        max-width: 1320px;
    }

    /* Change the font size of navigation */
    .navigation {
        font-size: 14px !important;
    }
}

/* Turn off display of search icon */
.header.content .search-toggle-icon {
    display: none;
}
