/* ---------------------------------------------------------------
   catalog.css - category page of mmoscal
   Linked from index.tpl.html AFTER head.tpl.html, so it loads after
   style.css / trig.css / media.css and wins the cascade.

   Markup: category.tpl.html (head, sort row, .cat_prod.ct-grid)
           product_brief.tpl.html (.ct-card)
   Logic:  js/catalog.js (price format, compare hearts, card click)

   The old card classes (.product_brief, .des_new, .price, #price1..3)
   are NOT reused on purpose - they carry float/width rules from four
   different files. The new card lives in its own ct- namespace.
   --------------------------------------------------------------- */

/* ---- page head --------------------------------------------------- */

.ct-head {
    margin-bottom: 16px;
}

.ct-head .ct-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #7a99a9;
}

.ct-head .ct-crumbs a {
    color: #1b6f9c;
    text-decoration: none;
}

.ct-head .ct-crumbs a:hover {
    text-decoration: underline;
}

.ct-head .ct-crumbs svg {
    display: block;
}

.ct-head .ct-sep {
    color: #bcdcec;
}

h1.ct-title {
    margin: 0 0 12px;
    padding: 0;
    font-size: 32px;
    line-height: 1.15;
    font-weight: bold;
    color: #123f63;
    border: 0;
    background: none;
}

/* ---- order conditions -------------------------------------------- */

.ct-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin-bottom: 14px;
    font-size: 14px;
    color: #1b6f9c;
}

.ct-badge {
    display: flex;
    align-items: center;
    gap: 7px;
}

.ct-badge svg {
    flex: 0 0 auto;
    color: #2585b4;
}

.ct-badge-sep {
    width: 1px;
    height: 18px;
    background: #cfe6f3;
}

/* ---- collapsible category text ----------------------------------- */

.ct-info {
    margin-bottom: 16px;
    border: 1px solid #a0d3eb;
    border-radius: 10px;
    background: #f2f9fc;
    overflow: hidden;
}

.ct-info-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 13px 16px;
    border: 0;
    background: none;
    font: inherit;
    font-size: 15px;
    color: #123f63;
    text-align: left;
    cursor: pointer;
}

.ct-info-head:hover {
    background: #e6f3f9;
}

.ct-info-head .ct-info-ico {
    flex: 0 0 auto;
    color: #2585b4;
}

.ct-info-head .ct-info-chev {
    flex: 0 0 auto;
    margin-left: auto;
    color: #1b6f9c;
    transition: transform .2s ease;
}

.ct-info.is-open .ct-info-chev {
    transform: rotate(180deg);
}

.ct-info-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}

.ct-info-in {
    padding: 12px 16px 14px;
    border-top: 1px solid #cfe6f3;
    line-height: 1.6;
    color: #2b5f7f;
}

.ct-info-in p {
    margin: 0 0 8px;
}

.ct-info-in p:last-child {
    margin: 0;
}

/* ---- sort row ----------------------------------------------------- */

.ct-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: 0 0 16px;
}

.ct-tools .sortirrtop,
.ct-tools .sortirr {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
}

.ct-tools select {
    padding: 8px 12px;
    border: 1px solid #a0d3eb;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    color: #123f63;
    cursor: pointer;
}

.ct-tools a {
    color: #1b6f9c;
}

/* ---- product grid -------------------------------------------------- */

.cat_prod.ct-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    float: none !important;
    width: auto !important;
}

.ct-card {
    position: relative;
    z-index: 0;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: #fff;
    border: 1px solid #cfe6f3;
    border-radius: 12px;
    cursor: pointer;
}

.ct-card:hover {
    border-color: #a0d3eb;
    box-shadow: 0 6px 18px rgba(18, 63, 99, .10);
}

/* fixed 4:3 frame - padding trick instead of aspect-ratio, the shop is
   still opened in old browsers from search traffic */

.ct-card-media {
    position: relative;
    padding-top: 75%;
    border-radius: 8px;
    overflow: hidden;
    background: #f7fafc;
}

/* trig.css:2461 pins .swinger-container to a fixed width: 275px. With
   left/right/width all set, the browser keeps width and drops right -
   that is why the photo ended short of the card edge. width/height are
   forced here; the mobile override in media.css already used auto. */

.ct-card-media > a.link_brief,
.ct-card-media > .swinger-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left;
}

.ct-card-media .swinger-container > a {
    display: block;
    width: 100%;
    height: 100%;
}

/* swinger_loud.js writes inline position/size on every photo it loads on
   hover, and inline styles beat plain rules - hence !important here.
   Opacity and z-index are left alone, the hover switch still works. */

.ct-card-media img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    /* cover, not contain: product photos come in different proportions and
       contain left a white block with empty space beside it. box-shadow is
       killed here - style.css:1459 puts one on every a.link_brief img. */
    object-fit: cover;
    object-position: center;
    display: block;
    background: none;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* photo much wider/taller than the 4:3 frame - fit it whole instead of
   cropping (js/catalog.js, fitPhoto); white like the photo backgrounds */
.ct-card-media img.ct-img--fit {
    object-fit: contain;
    background: #fff;
}

.ct-card-media .a1k2 {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 6px;
    z-index: 3;
}

/* discount plate */

.ct-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    padding: 4px 9px;
    border-radius: 6px;
    background: #f2c16b;
    color: #5c4409;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.2;
}

/* favorites heart (js/catalog.js, cookie mm_fav) */

.ct-fav {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cfe6f3;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #7a99a9;
    cursor: pointer;
}

.ct-fav:hover {
    color: #1b6f9c;
    border-color: #a0d3eb;
}

.ct-fav.is-on {
    color: #e05a4e;
    border-color: #f0b7b1;
    background: #fff;
}

.ct-fav.is-on svg path {
    fill: currentColor;
}

/* card text */

.ct-card-name {
    margin: 11px 0 0;
    padding: 0;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.3;
}

.ct-card-name a {
    color: #1b6f9c;
    text-decoration: none;
}

.ct-card-name a:hover {
    text-decoration: underline;
}

.ct-card-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 11px;
}

.ct-prices {
    display: block;
}

.ct-price-old {
    display: block;
    font-size: 14px;
    line-height: 1.2;
    color: #c0554c;
    text-decoration: line-through;
}

.ct-price-new {
    display: block;
    font-size: 22px;
    font-weight: bold;
    line-height: 1.2;
    color: #123f63;
    white-space: nowrap;
}

.ct-more {
    flex: 0 0 auto;
    padding: 11px 18px;
    border-radius: 8px;
    background: #1b6f9c;
    color: #fff !important;
    font-size: 13px;
    text-decoration: none !important;
}

.ct-more:hover {
    background: #12507d;
}

/* ---- compare bar --------------------------------------------------- */

.ct-cmp {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px 11px 18px;
    border-radius: 10px;
    background: #123f63;
    color: #fff;
    box-shadow: 0 10px 26px rgba(18, 63, 99, .3);
    transform: translateX(-50%) translateY(160%);
    transition: transform .25s ease;
}

.ct-cmp.is-on {
    transform: translateX(-50%) translateY(0);
}

.ct-cmp-btn {
    padding: 8px 16px;
    border: 0;
    border-radius: 7px;
    background: #f2c16b;
    color: #4a3505;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
}

.ct-cmp-btn:hover {
    background: #ffd67a;
}

.ct-cmp-x {
    padding: 0 2px;
    border: 0;
    background: none;
    color: #a8cfe2;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}

.ct-cmp-x:hover {
    color: #fff;
}

/* ---- responsive ----------------------------------------------------- */

/* columns grow with the screen: 3 on a laptop, 4 on Full HD, more above */

@media only screen and (min-width: 1100px) {

    .cat_prod.ct-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media only screen and (min-width: 1600px) {

    .cat_prod.ct-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media only screen and (min-width: 2100px) {

    .cat_prod.ct-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media only screen and (min-width: 2600px) {

    .cat_prod.ct-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* plitok v ryad zadany v okne kategorii (dzmtTilesResolve, category.tpl.html
   .ct-grid--t3..t6): ot 1600 px - rovno stolko, uzhe - kak obychno (3, 2) */

/* 5-6 v ryad: na noutbuke (1100-1599) - po 4, inache kartochka shire 400 px,
   a prevyu u nikh 300 (dz_thumb_ws) */
@media only screen and (min-width: 1100px) and (max-width: 1599px) {

    .cat_prod.ct-grid.ct-grid--t5,
    .cat_prod.ct-grid.ct-grid--t6 { grid-template-columns: repeat(4, 1fr); }
}

@media only screen and (min-width: 1600px) {

    .cat_prod.ct-grid.ct-grid--t3 { grid-template-columns: repeat(3, 1fr); }
    .cat_prod.ct-grid.ct-grid--t4 { grid-template-columns: repeat(4, 1fr); }
    .cat_prod.ct-grid.ct-grid--t5 { grid-template-columns: repeat(5, 1fr); }
    .cat_prod.ct-grid.ct-grid--t6 { grid-template-columns: repeat(6, 1fr); }
}

@media only screen and (max-width: 985px) {

    h1.ct-title {
        font-size: 26px;
    }

    .ct-badges {
        font-size: 13px;
        gap: 8px 14px;
    }
}

@media only screen and (max-width: 640px) {

    h1.ct-title {
        font-size: 22px;
    }

    .cat_prod.ct-grid {
        gap: 10px;
    }

    .ct-card {
        padding: 8px;
    }

    .ct-card-name {
        font-size: 14px;
    }

    .ct-card-foot {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .ct-price-new {
        font-size: 18px;
    }

    .ct-more {
        padding: 10px 12px;
        text-align: center;
    }

    .ct-badge-sep {
        display: none;
    }

    .ct-cmp {
        left: 10px;
        right: 10px;
        bottom: 10px;
        transform: translateX(0) translateY(160%);
        justify-content: space-between;
    }

    .ct-cmp.is-on {
        transform: translateX(0) translateY(0);
    }
}

/* ---- page foot: "show more", pagination, text, subcategories,
   recommended, help, links.
   Markup: category.tpl.html (ctf-*), data: core_functions/dz_cat_foot_functions.php
   (edited in the category window category.php, "Низ категории на витрине"). */

.load_more_center.ctf-more {
    padding: 24px 0 16px;
    text-align: center;
}

.ctf-more .load_more_btn {
    min-width: 238px;
    height: 40px;
    padding: 0 32px;
    border: 0;
    border-radius: 8px;
    background: #0d6efd;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: 0 4px 12px rgba(13, 110, 253, .22);
    cursor: pointer;
    transition: background .2s ease, box-shadow .2s ease, transform .15s ease;
}

.ctf-more .load_more_btn:hover {
    background: #0b5ed7;
    box-shadow: 0 6px 16px rgba(13, 110, 253, .32);
    transform: translateY(-1px);
}

.ctf-more .load_more_btn:active {
    transform: translateY(0);
}

.ctf-more .load_more_btn:focus-visible {
    outline: 3px solid rgba(13, 110, 253, .35);
    outline-offset: 2px;
}

/* pagination */
.ctf-nav {
    margin: 0 0 30px;
}

.ctf-pag {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ctf-pag__nums {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 8px;
}

.ctf-pag__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 4px;
    box-sizing: border-box;
    border-radius: 17px;
    color: #123f63;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

a.ctf-pag__num:hover {
    background: #eaf2fd;
    color: #0d6efd;
    text-decoration: none;
}

.ctf-pag__num.is-cur {
    background: #0d6efd;
    color: #fff;
    font-weight: 600;
}

.ctf-pag__gap {
    min-width: 22px;
    color: #123f63;
    text-align: center;
}

.ctf-pag__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 18px 0 14px;
    box-sizing: border-box;
    border: 1px solid #d6e2ee;
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(18, 63, 99, .08);
    color: #123f63;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.ctf-pag__next {
    padding: 0 14px 0 18px;
}

a.ctf-pag__btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    box-shadow: 0 2px 8px rgba(13, 110, 253, .15);
    text-decoration: none;
}

.ctf-pag__btn.is-off {
    color: #a9b7c6;
    box-shadow: none;
    cursor: default;
}

/* shared headings */
h2.ctf-h2,
h2.ctf-seo__title {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #123f63;
    font-weight: 700;
    text-align: left;
}

h2.ctf-h2 {
    font-size: 30px;
    line-height: 1.2;
}

/* text about the category */
.ctf-seo {
    display: block;
    margin: 0 0 40px;
    padding: 20px;
    border-radius: 18px;
    background: #f3f8fe;
    color: #4a5a6e;
}

.ctf-seo--img {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 28px;
}

.ctf-seo__img {
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 4 / 2.8;
    background: #e6eef7;
}

.ctf-seo__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ctf-seo__body {
    padding: 8px 14px 8px 4px;
}

.ctf-seo:not(.ctf-seo--img) .ctf-seo__body {
    padding: 8px 12px;
}

h2.ctf-seo__title {
    margin-bottom: 18px;
    font-size: 34px;
    line-height: 1.2;
}

.ctf-seo__intro,
.ctf-seo__full {
    font-size: 16px;
    line-height: 1.55;
}

.ctf-seo__intro p,
.ctf-seo__full p {
    margin: 0 0 8px;
}

.ctf-seo__intro p:last-child,
.ctf-seo__full p:last-child {
    margin-bottom: 0;
}

.ctf-seo__full img {
    max-width: 100%;
    height: auto;
}

/* with a short text: the full text opens below it */
.ctf-seo:not(.ctf-seo--clamp) .ctf-seo__full {
    display: none;
    margin-top: 10px;
}

.ctf-seo.is-open .ctf-seo__full {
    display: block;
}

/* without it: the beginning of the description, faded out */
.ctf-seo--clamp .ctf-seo__full {
    position: relative;
    max-height: 6.2em;
    overflow: hidden;
}

.ctf-seo--clamp:not(.is-open):not(.is-short) .ctf-seo__full::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2.4em;
    background: linear-gradient(rgba(243, 248, 254, 0), #f3f8fe 85%);
}

.ctf-seo--clamp.is-open .ctf-seo__full,
.ctf-seo--clamp.is-short .ctf-seo__full {
    max-height: none;
}

.ctf-seo__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    padding: 0;
    border: 0;
    background: none;
    color: #0d6efd;
    font-size: 16px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
}

.ctf-seo__more:hover {
    color: #0a58ca;
}

.ctf-seo.is-open .ctf-seo__more svg {
    transform: rotate(-90deg);
}

/* subcategories: a strip with arrows */
.ctf-sub {
    margin: 0 0 40px;
}

.ctf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 18px;
}

.ctf-arrows {
    display: flex;
    gap: 12px;
}

.ctf-sub.is-static .ctf-arrows {
    display: none;
}

.ctf-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1.5px solid #0d6efd;
    border-radius: 50%;
    background: #fff;
    color: #0d6efd;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.ctf-arrow:hover:not(:disabled) {
    background: #0d6efd;
    color: #fff;
}

.ctf-arrow:disabled {
    border-color: #d6e2ee;
    color: #a9b7c6;
    cursor: default;
}

.ctf-sub__track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.ctf-sub__track::-webkit-scrollbar {
    display: none;
}

.ctf-subcard {
    flex: 0 0 calc((100% - 60px) / 6);
    min-width: 140px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e1eaf3;
    border-radius: 10px;
    background: #fff;
    scroll-snap-align: start;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .2s ease;
}

.ctf-subcard:hover {
    border-color: #9cc3f5;
    box-shadow: 0 6px 18px rgba(18, 63, 99, .1);
    text-decoration: none;
}

.ctf-subcard__img {
    display: block;
    aspect-ratio: 1 / 1.05;
    background: #f0f4f8;
    overflow: hidden;
}

.ctf-subcard__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.ctf-subcard:hover .ctf-subcard__img img {
    transform: scale(1.04);
}

.ctf-subcard__name {
    padding: 14px 8px 18px;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.3;
    text-align: center;
}

/* recommended: big cards */
.ctf-recs {
    margin: 0 0 36px;
}

.ctf-recs h2.ctf-h2 {
    margin-bottom: 20px;
}

.ctf-recs__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.ctf-rec {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e1eaf3;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .2s ease;
}

.ctf-rec:hover {
    border-color: #9cc3f5;
    box-shadow: 0 8px 22px rgba(18, 63, 99, .12);
    text-decoration: none;
}

.ctf-rec__img {
    display: block;
    aspect-ratio: 16 / 9;
    background: #f0f4f8;
    overflow: hidden;
}

.ctf-rec__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.ctf-rec:hover .ctf-rec__img img {
    transform: scale(1.03);
}

.ctf-rec__name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 20px;
    color: #123f63;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.ctf-rec__name svg {
    flex: 0 0 auto;
    color: #123f63;
    transition: transform .15s ease, color .15s ease;
}

.ctf-rec:hover .ctf-rec__name svg {
    color: #0d6efd;
    transform: translateX(4px);
}

/* help */
.ctf-help {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 0 0 24px;
    padding: 24px 28px;
    border-radius: 16px;
    background: #f3f8fe;
}

.ctf-help__ico {
    flex: 0 0 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 84px;
    border: 1px solid #d6e2ee;
    border-radius: 50%;
    background: #fff;
    color: #0d6efd;
}

.ctf-help__txt {
    flex: 1 1 auto;
    min-width: 0;
}

.ctf-help__title {
    margin: 0 0 6px;
    color: #123f63;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
}

.ctf-help__text {
    color: #4a5a6e;
    font-size: 15px;
    line-height: 1.5;
}

.ctf-help__btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    box-sizing: border-box;
    padding: 0 22px;
    border-radius: 8px;
    background: #0d6efd;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(13, 110, 253, .22);
    transition: background .2s ease, box-shadow .2s ease;
}

.ctf-help__btn:hover {
    background: #0b5ed7;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(13, 110, 253, .32);
}

.ctf-help__btn svg {
    transition: transform .15s ease;
}

.ctf-help__btn:hover svg {
    transform: translateX(3px);
}

/* links with icons */
.ctf-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin: 0 0 30px;
    padding: 22px 0;
    border-top: 1px solid #e1eaf3;
}

.ctf-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 4px 44px;
    color: #1466c9;
    font-size: 15px;
    text-decoration: none;
}

.ctf-link + .ctf-link {
    border-left: 1px solid #d6e2ee;
}

.ctf-link svg {
    flex: 0 0 auto;
    color: #1466c9;
}

.ctf-link span {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ctf-link:hover span {
    color: #0a58ca;
}

@media only screen and (max-width: 985px) {
    .ctf-seo--img {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    h2.ctf-seo__title {
        font-size: 26px;
        margin-bottom: 12px;
    }

    h2.ctf-h2 {
        font-size: 24px;
    }

    .ctf-subcard {
        flex-basis: calc((100% - 36px) / 4);
    }

    .ctf-recs__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .ctf-help {
        flex-wrap: wrap;
    }

    .ctf-help__txt {
        flex-basis: calc(100% - 110px);
    }

    .ctf-link {
        padding: 4px 22px;
    }
}

@media only screen and (max-width: 640px) {
    .ctf-pag {
        gap: 6px;
    }

    .ctf-pag__nums {
        gap: 2px;
        margin: 0;
    }

    .ctf-pag__btn span {
        display: none;
    }

    .ctf-pag__btn,
    .ctf-pag__next {
        width: 38px;
        padding: 0;
        justify-content: center;
    }

    .ctf-seo {
        padding: 12px;
        margin-bottom: 28px;
    }

    h2.ctf-seo__title {
        font-size: 22px;
    }

    .ctf-seo__intro,
    .ctf-seo__full,
    .ctf-seo__more {
        font-size: 15px;
    }

    h2.ctf-h2 {
        font-size: 21px;
    }

    .ctf-arrow {
        width: 38px;
        height: 38px;
    }

    .ctf-subcard {
        flex-basis: calc((100% - 12px) / 2.3);
        min-width: 0;
    }

    .ctf-recs__grid {
        grid-template-columns: 1fr;
    }

    .ctf-rec__name {
        font-size: 16px;
        padding: 12px 16px;
    }

    .ctf-help {
        padding: 18px;
        gap: 14px;
    }

    .ctf-help__ico {
        flex-basis: 56px;
        height: 56px;
    }

    .ctf-help__ico svg {
        width: 26px;
        height: 26px;
    }

    .ctf-help__txt {
        flex-basis: calc(100% - 72px);
    }

    .ctf-help__title {
        font-size: 18px;
    }

    .ctf-help__btn {
        width: 100%;
        justify-content: center;
    }

    .ctf-links {
        flex-direction: column;
        align-items: center; /* íà òåëåôîíå ññûëêè «Ñáîðêà / Ñåðòèôèêàòû / Äîñòàâêà» - ïî öåíòðó */
        gap: 12px;
    }

    .ctf-link {
        padding: 2px 0;
    }

    .ctf-link + .ctf-link {
        border-left: 0;
    }
}

/* ---- list view (mattresses etc.): photo left, specs, price -----------
   Markup: product_brief.tpl.html (.ct-card.ct-row), the grid gets
   .ct-grid--list in category.tpl.html. Which categories use it is set in
   the admin (core_functions/dz_cat_view_functions.php). */

.cat_prod.ct-grid.ct-grid--list {
    grid-template-columns: 1fr;
}

.ct-card.ct-row {
    flex-direction: row;
    align-items: stretch;
    gap: 18px;
    padding: 14px;
}

/* the tile keeps its 4:3 frame with padding-top, which would be counted
   from the whole card width here - the frame gets a fixed width instead */
.ct-row .ct-card-media.ct-row__media {
    flex: 0 0 40%;
    max-width: 300px;
    padding-top: 0;
    min-height: 170px;
    aspect-ratio: 4 / 3;
    align-self: flex-start;
}

.ct-row__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.ct-row .ct-card-name {
    margin: 2px 0 0;
    font-size: 17px;
}

/* specs come from the product short description: a list gets check marks */
.ct-row__desc {
    margin: 10px 0 0;
    color: #34465c;
    font-size: 14px;
    line-height: 1.45;
}

.ct-row__desc p {
    margin: 0 0 6px;
    text-indent: 0;
}

.ct-row__desc ul,
.ct-row__desc ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ct-row__desc li {
    position: relative;
    margin: 0 0 6px;
    padding: 6px 10px 6px 34px;
    border-radius: 8px;
    background: #f3f8fc;
    list-style: none;
    background-image: none;
}

.ct-row__desc li::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border-radius: 50%;
    background: #1b6f9c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.ct-row__desc a {
    color: inherit;
    text-decoration: none;
}

.ct-row__desc img {
    max-width: 100%;
    height: auto;
}

.ct-row .ct-row__foot {
    padding-top: 14px;
}

@media only screen and (min-width: 1300px) {

    .cat_prod.ct-grid.ct-grid--list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media only screen and (min-width: 2100px) {

    .cat_prod.ct-grid.ct-grid--list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media only screen and (max-width: 640px) {

    .ct-card.ct-row {
        gap: 12px;
        padding: 10px;
    }

    .ct-row .ct-card-media.ct-row__media {
        flex-basis: 38%;
        min-height: 0;
    }

    .ct-row .ct-card-name {
        font-size: 15px;
    }

    .ct-row__desc {
        font-size: 13px;
    }

    .ct-row__desc li {
        padding: 4px 8px 4px 28px;
    }

    .ct-row__desc li::before {
        left: 6px;
    }
}

@media only screen and (max-width: 420px) {

    .ct-card.ct-row {
        flex-direction: column;
    }

    .ct-row .ct-card-media.ct-row__media {
        flex-basis: auto;
        width: 100%;
        max-width: none;
    }
}

/* ---- Категория выключена: заглушка «Раздел в разработке» (category.tpl.html,
   включается в окне категории category.php) ---- */
.ct-off {
    max-width: 640px;
    margin: 10px auto 40px;
    padding: 36px 28px;
    border: 1px solid #d9e6f2;
    border-radius: 16px;
    background: #f7fafe;
    text-align: center;
}
.ct-off__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: #e7f0ff;
    color: #0d6efd;
}
h2.ct-off__title {
    margin: 0 0 10px;
    color: #123f63;
    font-size: 24px;
    font-weight: 700;
}
.ct-off__text {
    margin: 0 auto 22px;
    max-width: 480px;
    color: #5b7489;
    font-size: 15px;
    line-height: 1.55;
}
.ct-off__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
a.ct-off__btn {
    display: inline-flex;
    align-items: center;
    padding: 11px 22px;
    border: 1px solid #0d6efd;
    border-radius: 24px;
    background: #0d6efd;
    color: #fff !important;
    font-weight: 600;
    text-decoration: none !important;
}
a.ct-off__btn:hover { background: #0b5ed7; }
a.ct-off__btn--ghost { background: #fff; color: #0d6efd !important; }
a.ct-off__btn--ghost:hover { background: #eef5ff; }
@media only screen and (max-width: 520px) {
    .ct-off { padding: 26px 16px; }
    h2.ct-off__title { font-size: 20px; }
}

/* ==========================================================================
   Категории «списком» (матрасы) по макету: подбор «Подберите матрас»,
   фильтры, сортировка, вид, карточки с характеристиками и иконками, баннер
   «Не знаете, какую жёсткость выбрать?», «Полезные категории».
   Разметка - category.tpl.html, product_brief.tpl.html (.dzm-card),
   данные - core_functions/dz_mattress_functions.php, JS - js/cat-filter.js.
   ========================================================================== */

.dzm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 26px;
    border: 1px solid #165e92;
    border-radius: 8px;
    background: #165e92;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.dzm-btn:hover { background: #0f4a75; border-color: #0f4a75; }
.dzm-btn--ghost { background: #fff; color: #165e92 !important; }
.dzm-btn--ghost:hover { background: #eef5fc; }

/* ---- подбор ---- */
.dzm-pick {
    display: grid;
    grid-template-columns: minmax(200px, 270px) 1fr;
    gap: 22px 30px;
    margin: 6px 0 18px;
    padding: 24px 26px;
    border: 1px solid #dbe8f4;
    border-radius: 16px;
    background: linear-gradient(135deg, #eef6fd 0%, #f7fbff 60%, #eaf3fb 100%);
}
.dzm-pick__title {
    margin: 0 0 10px;
    color: #123f63;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
}
.dzm-pick__intro p { margin: 0; color: #4f6a80; font-size: 14px; line-height: 1.45; }
.dzm-pick__steps { display: flex; flex-wrap: wrap; gap: 18px 0; }
.dzm-step { flex: 1 1 220px; min-width: 0; padding: 0 22px; border-left: 1px solid #d3e2ef; }
.dzm-step:first-child { padding-left: 0; border-left: 0; }
.dzm-step__head { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 12px; }
.dzm-step__head b { display: block; color: #123f63; font-size: 15px; }
.dzm-step__head span:not(.dzm-step__n) { display: block; margin-top: 2px; color: #6a8297; font-size: 12px; }
.dzm-step__n {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #1f74c2;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}
.dzm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dzm-chip {
    min-width: 70px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid #cfdeec;
    border-radius: 8px;
    background: #fff;
    color: #1d3a55;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.dzm-chip:hover { border-color: #1f74c2; color: #1f74c2; }
.dzm-chip.is-on { border-color: #1f74c2; background: #1f74c2; color: #fff; }
.dzm-pick__go { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 14px 26px; margin-top: 16px; }
.dzm-pick__go .dzm-btn { min-width: 186px; }
.dzm-link { display: inline-flex; align-items: center; gap: 8px; color: #1f74c2 !important; font-size: 14px; text-decoration: underline !important; text-underline-offset: 3px; }

/* ---- панель фильтров ---- */
.dzm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 12px; scroll-margin-top: 90px; }
.dzm-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.dzm-dd { position: relative; }
.dzm-dd__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px 0 14px;
    border: 1px solid #d3e0ec;
    border-radius: 8px;
    background: #fff;
    color: #1d3a55;
    font-size: 13px;
    cursor: pointer;
}
.dzm-dd__btn:hover, .dzm-dd.is-open .dzm-dd__btn { border-color: #1f74c2; }
.dzm-dd.is-set .dzm-dd__btn { border-color: #1f74c2; background: #eef5fc; color: #1f74c2; }
.dzm-dd__btn i { width: 8px; height: 8px; margin: -4px 0 0 18px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.dzm-dd.is-open .dzm-dd__btn i { margin-top: 4px; transform: rotate(-135deg); }
.dzm-dd__btn b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #1f74c2; color: #fff; font-size: 11px; line-height: 18px; }
.dzm-dd__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    min-width: 220px;
    max-height: 320px;
    overflow: auto;
    padding: 8px;
    border: 1px solid #dbe6f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(18, 63, 99, .15);
}
.dzm-dd__menu[hidden] { display: none; }
.dzm-opt { display: flex; align-items: center; gap: 10px; margin: 0; padding: 7px 8px; border-radius: 6px; color: #1d3a55; font-size: 13px; font-weight: 400; cursor: pointer; }
.dzm-opt:hover { background: #f1f7fc; }
.dzm-opt input { width: 16px; height: 16px; margin: 0; accent-color: #1f74c2; }
.dzm-dd__foot { position: sticky; bottom: -8px; display: flex; justify-content: space-between; gap: 8px; margin: 6px -8px -8px; padding: 8px; border-top: 1px solid #edf2f7; background: #fff; }
.dzm-dd__foot button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: #1f74c2; font-size: 13px; cursor: pointer; }
.dzm-dd__foot .dzm-dd__ok { background: #1f74c2; color: #fff; }
.dzm-bar__right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.dzm-sort { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: #6a8297; font-size: 13px; font-weight: 400; }
.dzm-sort__sel { height: 38px; padding: 0 30px 0 12px; border: 1px solid #d3e0ec; border-radius: 8px; background: #fff; color: #1d3a55; font-size: 13px; cursor: pointer; }
.dzm-view { display: inline-flex; gap: 6px; }
.dzm-view button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 1px solid #d3e0ec; border-radius: 8px; background: #fff; color: #5d7d99; cursor: pointer; }
.dzm-view button.is-on { border-color: #1f74c2; background: #1f74c2; color: #fff; }

.dzm-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -2px 0 12px; }
.dzm-active[hidden] { display: none; }
.dzm-active__n { margin-right: 4px; color: #6a8297; font-size: 13px; }
.dzm-active__n b { color: #123f63; }
.dzm-tag { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 12px; border: 0; border-radius: 15px; background: #e6f0fa; color: #1d3a55; font-size: 12.5px; cursor: pointer; }
.dzm-tag i { font-style: normal; color: #6a8297; font-size: 15px; }
.dzm-tag:hover i { color: #d0393e; }
.dzm-active__reset { height: 30px; padding: 0 6px; border: 0; background: none; color: #1f74c2; font-size: 13px; text-decoration: underline; cursor: pointer; }

/* ---- сетка и карточки ---- */
.cat_prod.ct-grid.ct-grid--list.dzm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cat_prod.ct-grid.ct-grid--list.dzm-grid.dzm-grid--c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dzm-grid--c2 .dzm-card .ct-card-media.ct-row__media { max-width: 300px; }
.cat_prod.ct-grid.ct-grid--list.dzm-grid.dzm-grid--list { grid-template-columns: minmax(0, 1fr); }
.dzm-card.ct-card.ct-row { gap: 16px; padding: 10px 14px 10px 10px; border-color: #dce8f2; border-radius: 14px; }
.dzm-card.ct-card.ct-row:hover { border-color: #a9cdea; box-shadow: 0 6px 22px rgba(18, 63, 99, .08); }
.dzm-card .ct-card-media.ct-row__media { flex: 0 0 48%; max-width: 250px; min-height: 0; border-radius: 10px; }
.dzm-card .ct-card-name { margin: 6px 0 0; font-size: 16px; line-height: 1.3; }
.dzm-card .ct-card-name a { color: #123f63; }
.dzm-feats { margin: 10px 0 0; padding: 0; list-style: none; }
.dzm-feat { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 8px; padding: 0; background: none; color: #34465c; font-size: 13.5px; line-height: 1.35; list-style: none; }
.dzm-feat::before { display: none; }
.dzm-feat__ico { display: inline-flex; flex: 0 0 auto; margin-top: -1px; color: #4f7898; }
.dzm-feat__txt { min-width: 0; }
.dzm-card .ct-row__foot { flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin-top: auto; padding-top: 10px; }
.dzm-prices { display: flex; flex-direction: column; }
.dzm-prices .ct-price-old { font-size: 12px; }
.dzm-price { color: #123f63; font-size: 20px; font-weight: 700; white-space: nowrap; }
.dzm-price small { font-size: 14px; font-weight: 600; }
.dzm-price .ct-price-new { display: inline; color: inherit; font-size: inherit; font-weight: inherit; }
.dzm-more.ct-more { margin-left: auto; padding: 10px 14px; background: #165e92; font-size: 13px; font-weight: 600; }
.dzm-more.ct-more:hover { background: #0f4a75; }

/* вид «списком»: одна карточка в ряд, характеристики в две колонки */
.dzm-grid--list .dzm-card .ct-card-media.ct-row__media { flex-basis: 30%; max-width: 260px; }
.dzm-grid--list .dzm-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }

.dzm-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 10px 0 20px; padding: 30px 20px; border: 1px dashed #cfdeec; border-radius: 14px; background: #f8fbfe; color: #4f6a80; text-align: center; }
.dzm-empty[hidden] { display: none; }
.dzm-empty b { color: #123f63; font-size: 17px; }

/* ---- баннер «Не знаете, какую жёсткость выбрать?» ---- */
.dzm-help {
    position: relative;
    display: grid;
    grid-template-columns: 220px 1fr auto 56px;
    align-items: center;
    gap: 20px 28px;
    margin: 22px 0 10px;
    padding: 14px 26px 14px 0;
    overflow: hidden;
    border: 1px solid #dbe8f4;
    border-radius: 16px;
    background: linear-gradient(90deg, #e6f0f9 0%, #f3f8fd 45%, #eaf3fb 100%);
}
.dzm-help__art { display: flex; align-items: flex-end; justify-content: center; align-self: stretch; margin: -14px 0; }
.dzm-help__art svg { display: block; width: 100%; height: auto; }
.dzm-help__title { margin: 0 0 6px; color: #123f63; font-size: 20px; font-weight: 700; line-height: 1.3; }
.dzm-help__title span { color: #1f74c2; }
.dzm-help__txt p { margin: 0; color: #4f6a80; font-size: 14px; line-height: 1.5; }
.dzm-help__ico { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: #d7e8f8; color: #1f74c2; }

/* ---- «Полезные категории» ---- */
.dzm-recs { margin: 22px 0 6px; }
.dzm-recs .ctf-h2 { margin-bottom: 12px; }
.dzm-recs__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dzm-rec {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 120px;
    padding: 10px 44px 10px 20px;
    border: 1px solid #dce8f2;
    border-radius: 12px;
    background: #fff;
    color: #123f63 !important;
    text-decoration: none !important;
    transition: border-color .15s, box-shadow .15s;
}
.dzm-rec:hover { border-color: #a9cdea; box-shadow: 0 6px 22px rgba(18, 63, 99, .08); }
.dzm-rec__name { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 700; }
.dzm-rec__img { flex: 0 0 auto; width: 150px; height: 100px; border-radius: 10px; overflow: hidden; background: #f3f7fb; }
.dzm-rec__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dzm-rec__go { position: absolute; right: 16px; top: 50%; margin-top: -9px; color: #5d7d99; }

@media only screen and (max-width: 1400px) {
    .cat_prod.ct-grid.ct-grid--list.dzm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media only screen and (max-width: 1100px) {
    .dzm-pick { grid-template-columns: 1fr; }
    .dzm-pick__title br { display: none; }
    .dzm-help { grid-template-columns: 160px 1fr; padding-right: 20px; }
    .dzm-help .dzm-btn { grid-column: 2; justify-self: start; }
    .dzm-help__ico { display: none; }
}
@media only screen and (max-width: 860px) {
    .cat_prod.ct-grid.ct-grid--list.dzm-grid,
    .cat_prod.ct-grid.ct-grid--list.dzm-grid.dzm-grid--c2 { grid-template-columns: minmax(0, 1fr); }
    .dzm-recs__list { grid-template-columns: minmax(0, 1fr); }
    .dzm-step { flex-basis: 100%; padding: 0; border-left: 0; }
    .dzm-pick__go { justify-content: flex-start; }
    .dzm-bar__right { margin-left: 0; width: 100%; justify-content: space-between; }
}
@media only screen and (max-width: 640px) {
    .dzm-pick { padding: 18px 16px; }
    .dzm-pick__title { font-size: 20px; }
    .dzm-help { grid-template-columns: 1fr; padding: 18px; text-align: left; }
    .dzm-help__art { display: none; }
    .dzm-help .dzm-btn { grid-column: auto; }
    .dzm-grid--list .dzm-feats { grid-template-columns: minmax(0, 1fr); }
    .dzm-dd__menu { position: fixed; top: auto; left: 12px; right: 12px; bottom: 12px; min-width: 0; max-height: 60vh; }
    .dzm-sort span { display: none; }
}
@media only screen and (max-width: 420px) {
    .dzm-card .ct-card-media.ct-row__media { flex-basis: auto; max-width: none; }
}

/* ---- значок «Новинка» / «Хит продаж» и оценка на карточке товара ----
   Значок задаётся в окне товара (products.php), оценка - опубликованные
   отзывы; данные - тег {dz_card} (core_functions/dz_badges_functions.php),
   разметка - product_brief.tpl.html (плитка и список). */

.ct-flag {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 20px);
    padding: 5px 11px 5px 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    line-height: 1.2;
    color: #123f63;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(18, 63, 99, .08);
}

.ct-flag svg {
    flex: 0 0 auto;
    display: block;
}

.ct-flag--hit {
    background: #fde3b4;
}

.ct-flag--new {
    background: #dcecfd;
}

/* точки листания фото (swinger) - выше значка, чтобы не наезжали */
.ct-card-media .ct-flag ~ .a1k2,
.ct-card-media .swinger-container .a1k2 {
    z-index: 3;
}

.ct-card-name a {
    color: #123f63;
}

.ct-rate {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 7px;
    font-size: 14px;
    line-height: 1.3;
    color: #123f63;
}

.ct-rate__star {
    flex: 0 0 auto;
    display: block;
}

.ct-rate__avg {
    font-size: 16px;
    font-weight: bold;
}

.ct-rate__dot {
    color: #9aaab8;
}

.ct-rate a.ct-rate__n {
    color: #1b6f9c;
    text-decoration: underline;
    text-decoration-color: rgba(27, 111, 156, .45);
    text-underline-offset: 3px;
}

.ct-rate a.ct-rate__n:hover {
    color: #12507d;
    text-decoration-color: currentColor;
}

.ct-rate__none {
    color: #8a97a6;
}

/* список (матрасы и др.): фото слева - значок там же, внизу слева */
.ct-row .ct-rate {
    margin-top: 4px;
    margin-bottom: 2px;
}

@media (max-width: 600px) {
    .ct-flag {
        left: 8px;
        bottom: 8px;
        padding: 4px 9px 4px 7px;
        font-size: 12px;
        gap: 5px;
    }
    .ct-flag svg {
        width: 14px;
        height: 14px;
    }
    .ct-rate {
        font-size: 13px;
    }
    .ct-rate__avg {
        font-size: 15px;
    }
}

/* значок «Хит продаж» / «Новинка» на главном фото в карточке товара -
   в левом верхнем углу (справа вверху - сердечко) */
.pd-gallery__main .ct-flag.pd-flag {
    left: 16px;
    top: 16px;
    bottom: auto;
    padding: 6px 13px 6px 10px;
    font-size: 14px;
}

.pd-gallery__main .ct-flag.pd-flag svg {
    width: 18px;
    height: 18px;
}

/* «Полезные категории» у матрасов на узком экране - фото поменьше */
@media only screen and (max-width: 640px) {
    .dzm-rec { min-height: 96px; }
    .dzm-rec__img { width: 110px; height: 76px; }
}

/* ---- Подкатегории наверху страницы категории (category.tpl.html, .ct-subs):
   карточка - картинка, название, стрелка; до 4 в ряд, неполный ряд
   растягивается на всю ширину. Где выводить подкатегории - окно категории
   category.php (core_functions/dz_cat_foot_functions.php, dzcfSubPlace) ---- */
.ct-subs { margin: 4px 0 18px; padding: 12px; border-radius: 14px; background: #eef5fb; }
.ct-subs__list { display: flex; flex-wrap: wrap; gap: 10px; }
.ct-sub {
    flex: 1 1 calc(25% - 8px);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 82px;
    padding: 8px 16px 8px 10px;
    border: 1px solid #dce8f2;
    border-radius: 10px;
    background: #fff;
    color: #123f63 !important;
    text-decoration: none !important;
    transition: border-color .15s, box-shadow .15s;
}
.ct-sub:hover { border-color: #a9cdea; box-shadow: 0 6px 18px rgba(18, 63, 99, .10); }
.ct-sub__img { flex: 0 0 70px; height: 66px; display: flex; align-items: center; justify-content: center; }
.ct-sub__img img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border: 0; box-shadow: none; }
.ct-sub__name { flex: 1 1 auto; min-width: 0; font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.ct-sub__go { flex: 0 0 auto; color: #1f74c2; transition: transform .15s; }
.ct-sub:hover .ct-sub__go { transform: translateX(3px); }
.ct-sub--more { display: none; }
.ct-subs.is-open .ct-sub--more { display: flex; }
.ct-subs__all {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px auto 0;
    padding: 7px 16px;
    border: 1px solid #c9dcee;
    border-radius: 18px;
    background: #fff;
    color: #1f74c2;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.ct-subs__all:hover { border-color: #1f74c2; }
.ct-subs__all svg { transition: transform .15s; }
.ct-subs.is-open .ct-subs__all svg { transform: rotate(180deg); }

@media only screen and (max-width: 1100px) {
    .ct-sub { flex-basis: calc(33.33% - 7px); }
}
@media only screen and (max-width: 760px) {
    .ct-subs { padding: 8px; }
    .ct-subs__list { gap: 8px; }
    .ct-sub { flex-basis: calc(50% - 4px); min-height: 70px; gap: 8px; padding: 6px 10px 6px 6px; }
    .ct-sub__img { flex-basis: 54px; height: 54px; }
    .ct-sub__name { font-size: 13px; }
}
@media only screen and (max-width: 420px) {
    .ct-sub { min-height: 60px; padding-right: 8px; }
    .ct-sub__img { flex-basis: 42px; height: 46px; }
    .ct-sub__name { font-size: 12.5px; }
    .ct-sub__go { display: none; }
}

/* ---- Сортировка и вид «плиткой / списком» над товарами - во всех
   категориях одинаково (category.tpl.html, #ct-bar; оформление - те же
   dzm-sort/dzm-view, что у матрасов) ---- */
.ct-bar { margin: 0 0 14px; }
.ct-bar__links[hidden] { display: none; }

/* вид «списком» у обычной плитки: #cat_prod_container.ct-rows - фото слева,
   справа название, оценка, краткое описание (.ct-card-desc, в плитке его
   не видно), цена и кнопка */
.ct-card-desc { display: none; }
#cat_prod_container.ct-rows .cat_prod.ct-grid { grid-template-columns: minmax(0, 1fr); }
.ct-rows .ct-card:not(.ct-row) {
    display: grid;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    grid-auto-rows: auto;
    column-gap: 20px;
    row-gap: 0;
    align-content: start;
    padding: 14px;
}
/* рамка 4:3 через padding-top в сетке считается не от колонки - высота
   через aspect-ratio, как у .ct-row */
.ct-rows .ct-card:not(.ct-row) > .ct-card-media { grid-column: 1; grid-row: 1 / span 12; align-self: start; padding-top: 0; aspect-ratio: 4 / 3; }
.ct-rows .ct-card:not(.ct-row) > :not(.ct-card-media) { grid-column: 2; }
.ct-rows .ct-card:not(.ct-row) .ct-card-name { margin: 2px 0 0; font-size: 18px; }
.ct-rows .ct-card-desc { display: block; }
.ct-rows .ct-card:not(.ct-row) .ct-card-foot { justify-content: flex-start; align-items: center; gap: 22px; margin-top: 0; padding-top: 14px; }

@media only screen and (min-width: 1300px) {
    .ct-rows .ct-card-desc ul,
    .ct-rows .ct-card-desc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
}
/* «ñïèñêîì» ïî 2-3 â ðÿä - íàñòðîéêà «Êàðòî÷åê â ðÿä (âèä „Ñïèñîê“)»
   (includes/category.php -> ct-rows-c2|c3 ó #cat_prod_container): 2 â ðÿä
   îò 1100 px, 3 - îò 1500 px (íà 1100-1499 - 2); ôîòî óæå, õàðàêòåðèñòèêè
   â îäíó êîëîíêó */
@media only screen and (min-width: 1100px) {
    #cat_prod_container.ct-rows.ct-rows-c2 .cat_prod.ct-grid,
    #cat_prod_container.ct-rows.ct-rows-c3 .cat_prod.ct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ct-rows.ct-rows-c2 .ct-card:not(.ct-row),
    .ct-rows.ct-rows-c3 .ct-card:not(.ct-row) { grid-template-columns: minmax(0, 42%) minmax(0, 1fr); column-gap: 16px; }
    .ct-rows.ct-rows-c2 .ct-card-desc ul, .ct-rows.ct-rows-c2 .ct-card-desc ol,
    .ct-rows.ct-rows-c3 .ct-card-desc ul, .ct-rows.ct-rows-c3 .ct-card-desc ol { display: block; }
    .ct-rows.ct-rows-c2 .ct-card:not(.ct-row) .ct-card-name,
    .ct-rows.ct-rows-c3 .ct-card:not(.ct-row) .ct-card-name { font-size: 16px; }
    .ct-rows.ct-rows-c2 .ct-card:not(.ct-row) .ct-card-foot,
    .ct-rows.ct-rows-c3 .ct-card:not(.ct-row) .ct-card-foot { flex-wrap: wrap; gap: 10px 16px; }
}
@media only screen and (min-width: 1500px) {
    #cat_prod_container.ct-rows.ct-rows-c3 .cat_prod.ct-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media only screen and (max-width: 640px) {
    .ct-rows .ct-card:not(.ct-row) { grid-template-columns: minmax(0, 38%) minmax(0, 1fr); column-gap: 12px; padding: 10px; }
    .ct-rows .ct-card:not(.ct-row) .ct-card-name { font-size: 15px; }
    .ct-rows .ct-card-desc { font-size: 13px; }
    .ct-rows .ct-card:not(.ct-row) .ct-card-foot { align-items: stretch; gap: 8px; }
}
@media only screen and (max-width: 420px) {
    .ct-rows .ct-card:not(.ct-row) { grid-template-columns: minmax(0, 1fr); }
    .ct-rows .ct-card:not(.ct-row) > .ct-card-media,
    .ct-rows .ct-card:not(.ct-row) > :not(.ct-card-media) { grid-column: 1; grid-row: auto; }
}

/* ---- Страница «Каталог продукции» (catalog.tpl.html, index.php?catalog=yes):
   карточки категорий верхнего уровня - картинка 4:3 и название со стрелкой.
   Сетка тянется на всю ширину: 2 в ряд на телефоне, 3-4 на компьютере ---- */
.cat-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 10px 0 30px; }
.cat-all__item { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid #dce8f2; border-radius: 12px; background: #fff; color: #123f63 !important; text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.cat-all__item:hover { border-color: #a9cdea; box-shadow: 0 6px 18px rgba(18, 63, 99, .10); }
.cat-all__img { position: relative; display: block; padding-top: 75%; background: #f3f7fb; overflow: hidden; }
.cat-all__img img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; border: 0; transition: transform .3s ease; }
.cat-all__item:hover .cat-all__img img { transform: scale(1.04); }
.cat-all__name { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px 12px; font-size: 15px; font-weight: 700; line-height: 1.3; }
.cat-all__name svg { flex: 0 0 auto; color: #1f74c2; transition: transform .15s; }
.cat-all__item:hover .cat-all__name svg { transform: translateX(3px); }
@media only screen and (max-width: 640px) {
    .cat-all { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
    .cat-all__name { padding: 8px 10px 10px; font-size: 13px; }
    .cat-all__name svg { display: none; }
}

/* ---- Kollekcii (category.tpl.html, .ct-colls): podkategorii krupnymi
   kartochkami po dve v ryad - foto, nazvanie, knopka. Vklyuchaetsya v okne
   kategorii category.php (dzcsIsColl, core_functions/dz_cat_state_functions.php) ---- */
.ct-colls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 4px 0 24px; }
.ct-coll {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e3ecf4;
    border-radius: 12px;
    background: #fff;
    color: #10294a !important;
    text-decoration: none !important;
    box-shadow: 0 2px 10px rgba(18, 63, 99, .05);
    transition: box-shadow .2s, border-color .2s;
}
.ct-coll:hover { border-color: #c5dbee; box-shadow: 0 10px 26px rgba(18, 63, 99, .12); }
.ct-coll__img { display: block; aspect-ratio: 650 / 230; overflow: hidden; background: #eef3f8; }
.ct-coll__img img { display: block; width: 100%; height: 100%; object-fit: cover; border: 0; box-shadow: none; transition: transform .4s; }
.ct-coll:hover .ct-coll__img img { transform: scale(1.03); }
.ct-coll__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 22px; }
.ct-coll__name { min-width: 0; font-size: 21px; font-weight: 700; line-height: 1.25; color: #10294a; }
.ct-coll__btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 10px 22px;
    border-radius: 10px;
    background: #0f4c81;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .2s;
}
.ct-coll:hover .ct-coll__btn { background: #0b3c66; }
.ct-coll__btn svg { transition: transform .2s; }
.ct-coll:hover .ct-coll__btn svg { transform: translateX(3px); }

@media only screen and (max-width: 1100px) {
    .ct-colls { gap: 14px; }
    .ct-coll__name { font-size: 18px; }
    .ct-coll__btn { padding: 9px 14px 9px 16px; font-size: 13px; }
}

@media only screen and (max-width: 760px) {
    .ct-colls { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .ct-coll__img { aspect-ratio: 16 / 7; }
    .ct-coll__bar { padding: 10px 12px 10px 16px; }
}

@media only screen and (max-width: 400px) {
    .ct-coll__name { font-size: 16px; }
    .ct-coll__btn { padding: 8px 12px; gap: 6px; }
}

/* ---- product card in catalog, mockup "Agata bed" -----------
   Roboto (self-hosted, fonts/roboto/, Apache 2.0): name and price #123D60
   700, old price 14/400 #7C8794, outline button #19739B 15-16/600 from
   44 px high. Tile cards only (.ct-card:not(.ct-row)): list/mattress cards
   keep their own look. Narrow cards (5-6 in a row, phones) - price over
   the button, see the container query below. */

@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap;
    src: url(../fonts/roboto/roboto-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap;
    src: url(../fonts/roboto/roboto-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap;
    src: url(../fonts/roboto/roboto-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02AF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
/* Roboto has no 600: the 500 file covers 500-600 (button), no faux bold */
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500 600; font-display: swap;
    src: url(../fonts/roboto/roboto-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500 600; font-display: swap;
    src: url(../fonts/roboto/roboto-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; font-display: swap;
    src: url(../fonts/roboto/roboto-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; font-display: swap;
    src: url(../fonts/roboto/roboto-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; font-display: swap;
    src: url(../fonts/roboto/roboto-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02AF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

.ct-card:not(.ct-row) {
    --ctc-ink: #123D60;
    --ctc-old: #7C8794;
    --ctc-btn: #19739B;
    container-type: inline-size;
    box-sizing: border-box;
    padding: 14px;
    border: 1px solid #e6edf3;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(18, 61, 96, .07);
    font-family: Roboto, 'Segoe UI', Arial, sans-serif;
    transition: box-shadow .2s, border-color .2s, transform .2s;
}
.ct-card:not(.ct-row):hover {
    border-color: #d3e2ee;
    box-shadow: 0 10px 28px rgba(18, 61, 96, .13);
}
.ct-card:not(.ct-row) .ct-card-media { border-radius: 12px; }
.ct-card:not(.ct-row) .ct-card-name {
    margin: 16px 2px 0;
    font-family: inherit;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
}
.ct-card:not(.ct-row) .ct-card-name a { color: var(--ctc-ink); }
.ct-card:not(.ct-row) .ct-card-name a:hover { color: var(--ctc-btn); text-decoration: none; }
.ct-card:not(.ct-row) .ct-rate { margin-left: 2px; }
.ct-card:not(.ct-row) .ct-card-foot {
    align-items: flex-end;
    gap: 12px;
    padding: 18px 2px 2px;
}
.ct-card:not(.ct-row) .ct-price-old {
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--ctc-old);
    text-decoration: line-through;
}
.ct-card:not(.ct-row) .ct-price-new {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.01em;
    color: var(--ctc-ink);
}
.ct-card:not(.ct-row) .ct-more {
    box-sizing: border-box;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border: 1.5px solid var(--ctc-btn);
    border-radius: 12px;
    background: #fff;
    color: var(--ctc-btn) !important;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    transition: background .15s, color .15s;
}
.ct-card:not(.ct-row) .ct-more:hover,
.ct-card:not(.ct-row) .ct-more:focus-visible {
    background: var(--ctc-btn);
    color: #fff !important;
}

/* narrow card: price above, full-width button */
@container (max-width: 300px) {
    .ct-card:not(.ct-row) .ct-card-foot { flex-direction: column; align-items: stretch; gap: 10px; }
    .ct-card:not(.ct-row) .ct-price-new { font-size: 26px; }
    .ct-card:not(.ct-row) .ct-more { width: 100%; min-height: 44px; padding: 0 12px; font-size: 15px; }
}
@media only screen and (max-width: 640px) {
    .ct-card:not(.ct-row) { padding: 9px; border-radius: 14px; }
    .ct-card:not(.ct-row) .ct-card-media { border-radius: 10px; }
    .ct-card:not(.ct-row) .ct-card-name { margin-top: 10px; font-size: 15px; }
    .ct-card:not(.ct-row) .ct-card-foot { padding-top: 12px; }
    .ct-card:not(.ct-row) .ct-price-old { font-size: 13px; }
    .ct-card:not(.ct-row) .ct-price-new { font-size: 22px; }
    .ct-card:not(.ct-row) .ct-more { min-height: 44px; padding: 0 10px; font-size: 15px; }
    /* discount plate moves from the photo to the old price line */
    .ct-card:not(.ct-row) .ct-card-media .ct-sale { display: none; }
    .ct-card:not(.ct-row) .ct-price-old { display: inline; margin: 0 6px 0 0; vertical-align: middle; }
    .ct-card:not(.ct-row) .ct-sale-inline { display: inline-block; }
    .ct-card:not(.ct-row) .ct-price-new { margin-top: 3px; }
}
/* hidden on desktop: there the plate sits on the photo */
.ct-sale-inline {
    display: none;
    padding: 2px 6px;
    border-radius: 6px;
    background: #f2c16b;
    color: #5c4409;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    vertical-align: middle;
    white-space: nowrap;
}

/* ---- #moskal-category-article: bottom info block of a category ---------
   Markup is pasted into the category description (category.php, editor
   "Description"): <div id="moskal-category-article"> with
   .moskal-article__intro / __media / __lead / __note / __section /
   __checklist / __contact / __phone. Styles given by the owner. */
#moskal-category-article {
  --moskal-bg: #f3f8fd;
  --moskal-heading: #12486b;
  --moskal-text: #465d70;
  --moskal-link: #086ba8;
  --moskal-border: #d8e6f0;

  box-sizing: border-box;
  clear: both;
  width: 100%;
  margin: 32px 0;
  padding: 32px;
  border-radius: 20px;
  background: var(--moskal-bg);
  color: var(--moskal-text);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.7;
  text-align: left;
}

#moskal-category-article * {
  box-sizing: border-box;
}

#moskal-category-article h2,
#moskal-category-article h3,
#moskal-category-article p,
#moskal-category-article figure,
#moskal-category-article ul {
  margin: 0;
  padding: 0;
  float: none;
  text-align: left;
}

#moskal-category-article h2 {
  margin-bottom: 24px;
  color: var(--moskal-heading);
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
}

#moskal-category-article h3 {
  margin-bottom: 12px;
  color: var(--moskal-heading);
  font-size: 21px;
  line-height: 1.35;
  font-weight: 700;
}

#moskal-category-article p {
  color: var(--moskal-text);
  font-size: 16px;
  line-height: 1.7;
}

#moskal-category-article p + p {
  margin-top: 14px;
}

#moskal-category-article a {
  color: var(--moskal-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#moskal-category-article a:hover {
  color: #12486b;
}

#moskal-category-article a:focus-visible {
  outline: 3px solid #086ba8;
  outline-offset: 4px;
}

/* photo and short intro */
#moskal-category-article .moskal-article__intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}

#moskal-category-article .moskal-article__media {
  min-width: 0;
}

#moskal-category-article .moskal-article__media img {
  display: block;
  float: none;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 12px;
}

#moskal-category-article .moskal-article__media figcaption {
  margin-top: 8px;
  color: #596e7e;
  font-size: 12px;
  line-height: 1.5;
}

#moskal-category-article .moskal-article__lead {
  min-width: 0;
}

#moskal-category-article .moskal-article__note {
  margin-top: 20px;
  padding: 16px 18px;
  border-left: 3px solid var(--moskal-link);
  border-radius: 0 8px 8px 0;
  background: #ffffff;
  font-size: 15px;
}

/* text sections */
#moskal-category-article .moskal-article__section {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--moskal-border);
}

/* checklist */
#moskal-category-article .moskal-article__checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
}

#moskal-category-article .moskal-article__checklist li {
  margin: 0;
  padding: 17px 18px;
  border: 1px solid var(--moskal-border);
  border-radius: 12px;
  background: #ffffff;
  font-size: 15px;
  line-height: 1.65;
  list-style: none;
}

#moskal-category-article .moskal-article__checklist strong {
  display: block;
  margin-bottom: 4px;
  color: var(--moskal-heading);
  font-size: 16px;
}

#moskal-category-article .moskal-article__checklist li:last-child {
  grid-column: 1 / -1;
}

/* contact block */
#moskal-category-article .moskal-article__contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  padding: 22px;
  border: 1px solid var(--moskal-border);
  border-radius: 12px;
  background: #ffffff;
}

#moskal-category-article .moskal-article__contact strong {
  display: block;
  margin-bottom: 4px;
  color: var(--moskal-heading);
  font-size: 18px;
}

#moskal-category-article .moskal-article__contact p {
  font-size: 15px;
}

#moskal-category-article .moskal-article__phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 9px;
  background: var(--moskal-link);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

#moskal-category-article .moskal-article__phone:hover {
  background: #12486b;
  color: #ffffff;
}

/* mobile */
@media (max-width: 900px) {
  #moskal-category-article .moskal-article__intro {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 600px) {
  #moskal-category-article {
    margin: 24px 0;
    padding: 20px 18px;
    border-radius: 14px;
  }

  #moskal-category-article h2 {
    font-size: 25px;
    margin-bottom: 20px;
  }

  #moskal-category-article h3 {
    font-size: 20px;
  }

  #moskal-category-article .moskal-article__checklist {
    grid-template-columns: 1fr;
  }

  #moskal-category-article .moskal-article__contact {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 18px;
  }

  #moskal-category-article .moskal-article__phone {
    width: 100%;
  }
}

/* Category text with a photo, opened ("read more"): the photo stays at the
   top left and the text flows around it (the two-column grid centred the
   photo vertically - with a long text it ended up in the middle).
   #moskal-category-article inside: no own box and no clear, so it wraps too. */
.ctf-seo--img.is-open { display: flow-root; }
.ctf-seo--img.is-open .ctf-seo__img {
    float: left;
    width: 46%;
    margin: 0 28px 16px 0;
}
.ctf-seo--img.is-open .ctf-seo__body { padding-top: 0; }
/* clamp mode keeps overflow:hidden on the text - that blocks the wrap */
.ctf-seo.is-open .ctf-seo__full { overflow: visible; }
.ctf-seo #moskal-category-article {
    clear: none;
    margin: 16px 0 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
}
/* intro without a photo - text across the whole width */
#moskal-category-article .moskal-article__intro > :only-child { grid-column: 1 / -1; }
@media only screen and (max-width: 985px) {
    .ctf-seo--img.is-open .ctf-seo__img { float: none; width: auto; margin: 0 0 16px; }
}

/* Collapsed category text with #moskal-category-article: the article's own
   big heading took the whole 6.2em preview - show more lines. */
.ctf-seo--clamp:not(.is-open) .ctf-seo__full:has(#moskal-category-article),
.ctf-seo--art.ctf-seo--clamp:not(.is-open) .ctf-seo__full { max-height: 15em; }
/* the article's own H2 is the block heading (section title not printed) */
.ctf-seo--art #moskal-category-article { margin-top: 0; }
/* Section divider next to the floated photo: a border of a normal block runs
   under the float (a line across the photo). The divider is now a separate
   overflow:hidden block - such a block keeps clear of the float. */
.ctf-seo #moskal-category-article .moskal-article__section { border-top: 0; padding-top: 0; }
.ctf-seo #moskal-category-article .moskal-article__section::before {
    content: "";
    display: block;
    height: 0;
    overflow: hidden;
    margin-bottom: 26px;
    border-top: 1px solid var(--moskal-border);
}

/* ---- Search results page (search_simple.tpl.html): header as in a category,
   "Found N", empty result */
.ct-crumbs__cur { color: #6a8297; }
.ct-bar .ct-found { color: #5b6b80; font-size: 15px; }
.ct-bar .ct-found b { color: #123D60; font-weight: 700; }
.ct-nores { max-width: 640px; margin: 20px auto 40px; padding: 28px 24px; border: 1px solid #e2eef5; border-radius: 14px; background: #f7fbfd; text-align: center; color: #5b6b80; font-size: 15px; line-height: 1.5; }
.ct-nores__t { margin: 0 0 8px; color: #123D60; font-size: 20px; font-weight: 700; }
.ct-nores__btn { display: inline-flex; align-items: center; justify-content: center; height: 46px; margin-top: 12px; padding: 0 26px; border: 1px solid #19739B; border-radius: 10px; color: #19739B; font-weight: 600; text-decoration: none; }
.ct-nores__btn:hover { background: #19739B; color: #fff; }

/* ---- list cards (.ct-row, mattresses .dzm-card): price and button as in
   the tile card above - Roboto, price #123D60 700, old price 14/400
   #7C8794 struck through, outline button #19739B 16/600, 46 px high,
   fills on hover. The rest of the list card keeps its own look. */
.ct-card.ct-row {
    --ctc-ink: #123D60;
    --ctc-old: #7C8794;
    --ctc-btn: #19739B;
}
.ct-card.ct-row .ct-prices,
.ct-card.ct-row .ct-more { font-family: Roboto, 'Segoe UI', Arial, sans-serif; }
.ct-card.ct-row .ct-price-old,
.ct-card.ct-row .dzm-prices .ct-price-old {
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--ctc-old);
    text-decoration: line-through;
}
.ct-card.ct-row .ct-price-new,
.ct-card.ct-row .dzm-price {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.01em;
    color: var(--ctc-ink);
}
.ct-card.ct-row .dzm-price small { font-size: 16px; font-weight: 500; }
.ct-card.ct-row .dzm-price .ct-price-new { font-size: inherit; letter-spacing: inherit; }
.ct-card.ct-row .ct-more,
.ct-card.ct-row .dzm-more.ct-more {
    box-sizing: border-box;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border: 1.5px solid var(--ctc-btn);
    border-radius: 12px;
    background: #fff;
    color: var(--ctc-btn) !important;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.ct-card.ct-row .ct-more:hover,
.ct-card.ct-row .ct-more:focus-visible,
.ct-card.ct-row .dzm-more.ct-more:hover {
    background: var(--ctc-btn);
    color: #fff !important;
}
@media only screen and (max-width: 640px) {
    .ct-card.ct-row .ct-price-old, .ct-card.ct-row .dzm-prices .ct-price-old { font-size: 13px; }
    .ct-card.ct-row .ct-price-new, .ct-card.ct-row .dzm-price { font-size: 22px; }
    .ct-card.ct-row .ct-more, .ct-card.ct-row .dzm-more.ct-more { min-height: 44px; padding: 0 14px; font-size: 15px; }
    /* narrow screen: price on the left, full-width button under it */
    .ct-card.ct-row .ct-row__foot { flex-direction: column; align-items: stretch; gap: 10px; }
    .ct-card.ct-row .ct-row__foot .ct-prices { align-self: flex-start; text-align: left; }
    .ct-card.ct-row .ct-row__foot .ct-more { width: 100%; margin-left: 0; }
}

/* ---- phones: tile cards without the "Podrobnee" button, heart above the
   photo (not over the bed), 1 tile per row when set in admin
   (Katalog -> Vid tovarov v kategoriyah, body.dz-mob1 from index.tpl.html).
   The whole card is a link anyway: photo and name lead to the product. */
@media only screen and (max-width: 640px) {
    .ct-card:not(.ct-row) .ct-more { display: none; }
    .ct-card:not(.ct-row) .ct-card-foot { padding-top: 8px; justify-content: flex-start; align-items: flex-start; }
    .ct-card:not(.ct-row) .ct-prices { text-align: left; }
    .ct-card:not(.ct-row) .ct-card-media { margin-top: 38px; overflow: visible; }
    .ct-card:not(.ct-row) .ct-card-media > a.link_brief,
    .ct-card:not(.ct-row) .ct-card-media > .swinger-container { overflow: hidden; border-radius: 10px; }
    .ct-card:not(.ct-row) .ct-card-media .ct-fav { top: -38px; right: 0; width: 32px; height: 32px; }
    /* view "spiskom" (ct-rows): photo on the left, heart stays on it */
    .ct-rows .ct-card:not(.ct-row) .ct-card-media { margin-top: 0; overflow: hidden; }
    .ct-rows .ct-card:not(.ct-row) .ct-card-media .ct-fav { top: 6px; right: 6px; }
    body.dz-mob1 .cat_prod.ct-grid:not(.ct-grid--list) { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    body.dz-mob1 #cat_prod_container.ct-rows .cat_prod.ct-grid { grid-template-columns: minmax(0, 1fr); }
    body.dz-mob1 .ct-card:not(.ct-row) .ct-card-name { font-size: 17px; }
    body.dz-mob1 .ct-card:not(.ct-row) .ct-price-new { font-size: 26px; }
}

/* ---- phones: swipe through the photos of a tile (js/card-swipe.js) ---- */
.ct-card-media[data-sw] a.link_brief { touch-action: pan-y pinch-zoom; }
.ct-card-media img.ct-sw-img { visibility: hidden; z-index: 0; background: #fff; }
.ct-swd {
    position: absolute;
    left: 50%;
    bottom: 8px;
    z-index: 4;
    display: flex;
    gap: 5px;
    padding: 4px 7px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .78);
    transform: translateX(-50%);
    pointer-events: none;
}
.ct-swd i { width: 6px; height: 6px; border-radius: 50%; background: #b9c6d2; transition: background .2s, transform .2s; }
.ct-swd i.is-on { background: #19739B; transform: scale(1.25); }
@media only screen and (min-width: 641px) { .ct-swd { display: none; } }

/* ---- phones, 1 tile per row set in admin (body.dz-mob1): view switch
   "one" / "two" (.ct-two on #cat_prod_container) / "list"; the "one" button
   exists only there (category.tpl.html, search_simple.tpl.html) */
.dzm-view button[data-view="one"] { display: none; }
@media only screen and (max-width: 640px) {
    body.dz-mob1 .dzm-view button[data-view="one"] { display: inline-flex; }
    body.dz-mob1 .ct-two .cat_prod.ct-grid:not(.ct-grid--list) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    body.dz-mob1 .ct-two .ct-card:not(.ct-row) .ct-card-name { font-size: 15px; }
    body.dz-mob1 .ct-two .ct-card:not(.ct-row) .ct-price-new { font-size: 22px; }
}
