/*
 * Compact desktop/tablet layout.
 * The full desktop grid needs 1200px, while the phone layout remains below 768px.
 */
@media (min-width: 768px) and (max-width: 1199px) {
    html,
    body {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        padding-top: 64px;
    }

    .wrap {
        width: 100%;
        max-width: 1024px;
        margin-right: auto;
        margin-left: auto;
        padding-right: 32px;
        padding-left: 32px;
    }

    .row {
        display: flex;
        flex-wrap: wrap;
    }

    .column {
        width: calc(25% - 18px);
    }

    .column:not(:last-child) {
        margin-right: 24px;
    }

    .column.cols_2,
    .column.half {
        width: calc(50% - 12px);
    }

    .column.cols_3 {
        width: calc(75% - 6px);
    }

    .column.cols_4,
    .column.wide {
        width: 100%;
        margin-right: 0;
    }

    .h1,
    h1 {
        margin-bottom: 28px;
        font-size: 32px;
        line-height: 38px;
    }

    .h2,
    h2 {
        font-size: 22px;
        line-height: 28px;
    }

    #content h2.h1:not(:first-child) {
        margin-top: 72px;
    }

    /* Compact header: readable controls without squeezing the full navigation. */
    #header .fck-logo {
        top: -7px;
        left: 32px;
    }

    #header .fck-logo img {
        height: 46px;
    }

    .top-nav {
        height: 64px;
        padding: 20px 0;
    }

    .top-nav .wrap {
        align-items: center;
    }

    .top-nav .burger {
        width: 64px;
        height: 64px;
        margin: -20px -24px -20px 16px;
    }

    .main-nav {
        top: 64px;
    }

    .main-nav .first-lvl {
        max-width: 720px;
        margin: 16px auto 0;
        font-size: 19px;
        line-height: 24px;
    }

    .main-nav a {
        padding-right: 32px;
        padding-left: 32px;
    }

    .top-nav .search-form {
        padding-right: 32px;
        padding-left: 32px;
    }

    /* Promo artwork is authored at roughly 2.5:1, so preserve that ratio. */
    #slider {
        width: 100%;
        height: auto;
        min-height: 0;
        overflow: hidden;
        aspect-ratio: 2.5 / 1;
    }

    #slider .slick-list,
    #slider .slick-track {
        height: 100%;
    }

    #slider .slide {
        width: 100vw;
        height: 100%;
        min-height: 0;
        background-position: 50% 50%;
        background-size: cover;
    }

    #slider .slide > a {
        background-position: 50% 50%;
        background-size: cover;
    }

    #slider .slide .wrap {
        width: 100%;
        padding-right: 32px;
        padding-left: 32px;
    }

    #slider .slide h2 {
        right: 32px;
        bottom: 32px;
        left: 32px;
    }

    #slider .slick-dots {
        position: absolute;
        bottom: 20px;
        left: 32px;
        width: auto;
        margin: 0;
        padding: 0;
        justify-content: flex-start;
    }

    .sponsors-list .wrap {
        justify-content: center;
    }

    footer .wrap {
        display: grid;
        grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr);
        gap: 32px 48px;
    }

    footer dl + dl {
        margin-top: 0;
    }

    footer .quartex dd {
        margin-left: 0;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    #paper {
        padding-top: 40px;
    }

    #page-main #paper {
        padding-top: 0;
    }

    #page-main #paper .wrap,
    #paper > .wrap {
        padding-right: 32px;
        padding-left: 32px;
    }

    .main-section {
        padding-top: 64px;
        padding-bottom: 64px;
    }

    .main-section .h2,
    .main-section h1,
    .main-section h2 {
        margin-bottom: 40px;
    }

    .main-section .tabs {
        margin-top: -20px;
    }

    .category-header,
    .page-header {
        padding-top: 88px;
        padding-bottom: 40px;
    }

    .category-header.hero .wrap {
        padding-top: clamp(240px, 36vw, 330px);
        padding-bottom: 40px;
    }

    .main-banner a {
        width: 100%;
        background-position: 50% 50%;
        aspect-ratio: 2.4 / 1;
    }

    /* Legacy homepage category strip. */
    .home-categories[media="desktop"] {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 0;
    }

    .home-categories[media="desktop"] a {
        width: 100%;
        height: auto;
        margin: 0;
        aspect-ratio: 400 / 183;
        background-position: 50% 50%;
    }

    /* Current homepage category grids. */
    .home-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .home-grid a {
        width: 100%;
        min-width: 0;
    }

    .home-categories.large {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .home-categories.large a {
        width: 100%;
        min-width: 0;
    }

    .home-categories.large a strong {
        font-size: 32px;
        line-height: 38px;
    }

    /* Three comfortable product cards on full-width pages, two beside a sidebar. */
    .item-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: 16px;
        row-gap: 24px;
    }

    .cols_3 .item-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .item-list .item {
        min-width: 0;
        min-height: 390px;
        padding-bottom: 52px;
    }

    .main-section .item-list .item:nth-child(n + 5) {
        display: block;
    }

    .item-list .item i,
    .item-list.one-line .item i {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 230px;
        min-height: 0;
    }

    .item-list .item i img {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .item-list .item ins {
        padding: 14px;
        line-height: 16px;
    }

    .item-list .item h4 {
        margin-bottom: 8px;
        font-size: 13px;
        line-height: 16px;
    }

    .item-list .item .price {
        bottom: 14px;
        left: 14px;
        font-size: 18px;
    }

    .item-list .item .add-to-cart-icon,
    .item-list .item .add-to-cart-link {
        right: 14px;
        bottom: 14px;
    }

    /* Player carousel remains swipeable, but uses tablet-sized cards. */
    #shop-player {
        padding-top: 56px;
        padding-bottom: 56px;
        background-size: cover;
    }

    #shop-player h2 {
        margin-bottom: 28px;
    }

    #shop-player .players-carousel {
        width: calc(100% + 64px);
        margin: 0 -32px;
        padding-left: 32px;
    }

    #shop-player .player {
        width: calc((100vw - 96px) / 2);
        min-width: calc((100vw - 96px) / 2);
        max-width: 464px;
    }

    #shop-player .player a {
        height: clamp(440px, 56vw, 540px);
        padding: 32px 24px 64px;
        background-position: 50% 0;
        background-size: auto 76%;
    }

    #shop-player .player a h4 {
        font-size: 17px;
        line-height: 20px;
    }

    #shop-player .player a h4::before {
        font-size: 36px;
        line-height: 36px;
    }

    /* Scale the kit configurator to the available width instead of clipping it. */
    #complete-form {
        width: auto;
        overflow: hidden;
        background-size: cover;
    }

    #complete-form #three-of-us {
        width: min(760px, 100%);
        height: 390px;
        margin-right: auto;
        margin-left: auto;
    }

    #complete-form #three-of-us::after {
        top: 170px;
        left: 50%;
        width: 100vw;
        height: 420px;
        transform: translateX(-50%);
    }

    #complete-form #three-of-us .man {
        width: 290px;
        height: 390px;
    }

    #complete-form #three-of-us .man.current {
        top: -42px;
        width: 380px;
        height: 520px;
    }

    /* Product page: gallery and purchase data stay side by side on tablets. */
    .item-show {
        display: grid;
        grid-template-columns: 60px minmax(0, 1.15fr) minmax(300px, .85fr);
        gap: 20px;
        align-items: start;
    }

    .item-show .thumbs,
    .item-show .image,
    .item-show .side {
        width: auto;
        min-width: 0;
        margin: 0;
    }

    .item-show .thumbs {
        overflow: visible;
        padding: 0;
        white-space: normal;
    }

    .item-show .thumbs i {
        display: block;
        margin: 0 0 8px;
    }

    .item-show .image {
        margin-bottom: 0;
    }

    .item-show .side {
        padding-top: 0;
    }

    .item-show .side h1 {
        margin: 0 0 16px;
        padding: 0;
        border-bottom: 0;
        font-size: 28px;
        line-height: 34px;
    }

    .item-show .side .description {
        display: block;
    }

    .item-show .side .add-to-cart button {
        width: auto;
        min-width: 180px;
        font-size: 14px;
    }

    .sort-n-search {
        flex-direction: row;
        align-items: flex-end;
        gap: 16px;
    }

    .sort-n-search .category-search {
        flex: 1 1 280px;
        width: auto;
    }

    .sort-n-search .sorting-wrapper {
        margin-left: auto;
    }

    #cart-drawer,
    #sizes-drawer {
        right: 0;
        left: auto;
        width: min(440px, 100vw);
    }

    .table-scroll {
        margin-right: 0;
        margin-left: 0;
    }
}

@media (min-width: 768px) and (max-width: 899px) {
    .home-categories[media="desktop"],
    .home-grid,
    .item-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .item-list .item i,
    .item-list.one-line .item i {
        height: 260px;
    }

    .item-show {
        grid-template-columns: 52px minmax(0, 1fr) minmax(280px, .9fr);
        gap: 16px;
    }

    .item-show .thumbs i {
        width: 52px;
        height: 52px;
    }
}
