/* Responsive category images generated from originals uploaded in the admin panel. */
.category-image {
    display: block;
    box-sizing: border-box;
    max-width: 100%;
    object-fit: contain;
}

#menuCatalogSection .drop .category-image--catalog {
    width: 100%;
    height: 88px;
    max-width: 120px;
    margin: 0 auto;
}

#mainMenu .drop .category-image--submenu {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    margin: 0 10px 0 0;
    padding: 0;
}

#popSection .picture .category-image--home {
    width: min(100%, 200px);
    height: 100px;
    margin: 0 auto;
}

/* Two-column category grid on phones. Kept here to override the legacy
   single-column mobile rules from template.css without touching that file. */
@media (max-width: 767px) {
    #popSection {
        padding-bottom: 24px;
    }

    #popSection .limiter {
        padding-right: 12px;
        padding-left: 12px;
    }

    #popSection .heading {
        height: auto;
        padding: 28px 0 24px;
        font-size: 20px;
        line-height: 1.25;
    }

    #popSection .items {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        overflow: visible;
    }

    #popSection .items > .item,
    #popSection .items > .item:nth-child(n) {
        float: none;
        width: auto !important;
        height: auto;
        min-height: 190px;
        border: 1px solid #e7e8ea !important;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    #popSection .tabloid {
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        height: 100%;
        padding: 12px 8px 10px;
    }

    #popSection .picture {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100px;
        margin-bottom: 8px;
        line-height: normal;
    }

    #popSection .picture .category-image--home {
        width: 100%;
        max-width: 140px;
        height: 100px;
    }

    #popSection .name {
        display: flex;
        flex: 1 1 auto;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        margin: 0;
        padding: 6px 2px;
        font-size: 14px;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 359px) {
    #popSection .limiter {
        padding-right: 8px;
        padding-left: 8px;
    }

    #popSection .items {
        gap: 7px;
    }

    #popSection .items > .item,
    #popSection .items > .item:nth-child(n) {
        min-height: 178px;
    }

    #popSection .tabloid {
        padding-right: 6px;
        padding-left: 6px;
    }

    #popSection .name {
        font-size: 13px;
    }
}
