:root {
    --catalog-step-n2: clamp(0.694444rem, calc(0.192161vw + 0.649407rem), 0.88rem);
    --catalog-step-0: clamp(1rem, calc(0.38835vw + 0.908981rem), 1.375rem);
    --catalog-step-4: clamp(2.0736rem, calc(1.329019vw + 1.762111rem), 3.356934rem);
    --catalog-step-5: clamp(2.48832rem, calc(1.768644vw + 2.073794rem), 4.196167rem);
    --catalog-space-2xs: clamp(0.5rem, calc(0.194175vw + 0.45449rem), 0.6875rem);
    --catalog-space-s: clamp(1rem, calc(0.38835vw + 0.908981rem), 1.375rem);
    --catalog-space-xl: clamp(3rem, calc(1.165049vw + 2.726942rem), 4.125rem);
    --catalog-space-2xl: clamp(4rem, calc(1.553398vw + 3.635922rem), 5.5rem);
    --catalog-space-4xl: clamp(8rem, calc(3.106796vw + 7.271845rem), 11rem);
    --catalog-page-top: clamp(4.9rem, 7.71vw, 6.9375rem);
}

body.tax-product_cat {
    --color-ink: #1d1e1f;
    color: var(--color-ink);
    letter-spacing: -0.02em;
}

.tax-product_cat .site-main {
    min-height: 0;
}

.catalog-page {
    width: 100%;
    padding: var(--catalog-page-top) var(--fluid-gutter) var(--catalog-space-4xl);
}

.catalog-page__title {
    max-width: none;
    margin: 0 0 var(--catalog-space-xl);
    color: #1d1e1f;
    font-size: var(--catalog-step-5);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1.2;
}

.catalog-list {
    width: 100%;
}

.catalog-card {
    display: flex;
    flex-wrap: wrap;
    position: relative;
    width: 100%;
}

.catalog-card + .catalog-card {
    margin-top: calc(var(--catalog-space-xl) * 1.2);
}

.catalog-card__body,
.catalog-card__media {
    display: flex;
    flex: 0 0 50%;
    align-items: center;
    justify-content: center;
    width: 50%;
}

.catalog-card:nth-child(odd) {
    flex-direction: row-reverse;
}

.catalog-card__media {
    position: relative;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
}

.catalog-card__media::before {
    display: block;
    width: 100%;
    padding-top: 49.71475%;
    content: "";
}

.tax-product_cat .catalog-card__image {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    background: #fff;
    object-fit: cover;
}

.catalog-card__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: var(--catalog-space-xl);
    text-align: center;
}

.catalog-page--devices .catalog-page__title {
    margin-bottom: clamp(16px, 1.041667vw, 20px);
}

.catalog-page--devices {
    padding-top: 30px;
}

.catalog-page--devices :is(.catalog-page__breadcrumbs, .catalog-page__title) {
    margin-inline: calc(var(--site-chrome-gutter) - var(--fluid-gutter));
}

.catalog-page--devices .catalog-card__media::before {
    content: none;
}

.tax-product_cat .catalog-page--devices .catalog-card__image {
    position: static;
    width: 72%;
    max-width: 576px;
    height: auto;
    /* Remove equal white margins without changing the product scale. */
    margin-block: max(-96px, -12%);
    object-fit: contain;
}

.catalog-card__title {
    margin: 0 0 var(--catalog-space-s);
    color: #1d1e1f;
    font-size: var(--catalog-step-4);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1.2;
    text-decoration: none;
    word-break: break-word;
}

.catalog-card__description {
    margin: 0 0 var(--catalog-space-s);
    color: #757a7f;
    font-size: var(--catalog-step-0);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1.6;
}

.catalog-card__description > :where(p, ul, ol) {
    margin: 0;
}

.catalog-card__description > :where(p, ul, ol) + :where(p, ul, ol) {
    margin-top: 0.65em;
}

.catalog-card__description > :where(ul, ol) {
    padding-left: 1.35em;
}

.catalog-card__description li + li {
    margin-top: 0.2em;
}

.catalog-card__price--device {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 8px 12px;
    margin-bottom: 24px;
    color: #1d1e1f;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.catalog-card__price--device .amount {
    white-space: nowrap;
}

.catalog-card__price--device del {
    order: 2;
    color: #979b9f;
    font-size: 0.625em;
    font-weight: 400;
}

.catalog-card__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--catalog-space-2xs);
    width: 100%;
    max-width: calc(384px + var(--catalog-space-2xs));
    margin-inline: auto;
    position: relative;
    z-index: 2;
}

.catalog-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 47px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 88px;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.catalog-card__button--primary {
    border-color: #4d6aff;
    background: #4d6aff;
    color: #fff;
}

.catalog-card__button--primary:hover,
.catalog-card__button--primary:focus-visible {
    border-color: rgba(77, 106, 255, 0.9);
    background: rgba(77, 106, 255, 0.9);
    color: #fff;
}

.catalog-buy-menu {
    position: relative;
    width: 100%;
}

.catalog-buy-menu__toggle {
    position: relative;
    z-index: 4;
    overflow: hidden;
    isolation: isolate;
    letter-spacing: normal;
}

.catalog-buy-menu__toggle::before {
    pointer-events: none;
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(79.537720283deg, #4d6aff 3.2278%, #5219fa 97.719%);
    content: "";
    opacity: 0;
    transition: opacity 0.15s ease;
}

.catalog-buy-menu:is(:hover, :focus-within, .is-open) .catalog-buy-menu__toggle {
    border-color: transparent;
    box-shadow: 0 7px 12px rgba(0, 0, 0, 0.11);
    color: #fff;
}

.catalog-buy-menu:is(:hover, :focus-within, .is-open) .catalog-buy-menu__toggle::before {
    opacity: 1;
}

.catalog-buy-menu__popover {
    position: absolute;
    z-index: 3;
    top: -6px;
    left: -6px;
    display: grid;
    width: 203px;
    padding: 62.98px 5.5px 12.637px;
    border-radius: 30px;
    background: #f8f9fa;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

.catalog-buy-menu__popover[hidden] {
    display: none;
}

.catalog-buy-menu__option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 192px;
    height: 41.304px;
    margin: 0 auto 5.156px;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

.catalog-buy-menu__option:last-child {
    margin-bottom: 0;
}

.catalog-buy-menu__option > img {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 50%;
    width: 185.885px;
    height: 41.304px;
    border-radius: 999px;
    object-fit: cover;
    transform: translateX(-50%);
}

.catalog-buy-menu__option > span {
    position: relative;
    z-index: 1;
    color: #000;
    font-size: 14px;
    font-weight: 500;
}

.catalog-buy-menu__option--ozon {
    background: #1717f7;
}

.catalog-buy-menu__option--wildberries {
    background: linear-gradient(90deg, #ed20bd 0%, #9b19ed 100%);
}

.catalog-buy-menu__option--dns {
    background: #ff7d01;
}

.catalog-buy-menu__option--yandex_market {
    background: #ffdd00;
}

.catalog-buy-menu__option--one-click {
    appearance: none;
    padding: 0;
    border: 0;
    background: #fff;
    color: #000;
    font-family: Inter, Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
}

.catalog-card__button--secondary {
    border-color: #b3b6b9;
    background: transparent;
    color: #1d1e1f;
}

.catalog-card__button--secondary:hover,
.catalog-card__button--secondary:focus-visible {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.05);
    color: #1d1e1f;
}

.catalog-card__button--disabled {
    border-color: #d3d5d7;
    background: #f3f3f3;
    color: #a5a5a5;
    cursor: not-allowed;
}

.catalog-page .woocommerce-pagination {
    margin-top: var(--catalog-space-2xl);
}

.catalog-page__empty {
    margin: 0;
    color: #757a7f;
    font-size: var(--catalog-step-0);
}

/* Accessories use a compact merchandise list instead of the device showcase. */
.catalog-page--accessories {
    padding: 30px var(--site-chrome-gutter) 100px;
}

.catalog-page--accessories .catalog-page__title,
.catalog-page--devices .catalog-page__title {
    margin-top: 40px;
    font-size: clamp(48px, 3.384vw, 67px);
    line-height: 1.05;
}

.catalog-page--accessories .catalog-page__title {
    margin-bottom: 46px;
}

.catalog-page--accessories .catalog-list {
    display: grid;
    gap: 20px;
}

.catalog-page--accessories .catalog-card--accessory,
.catalog-page--accessories .catalog-card--accessory:nth-child(odd) {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    min-height: 250px;
    overflow: visible;
    border: 1px solid #e4e7eb;
    border-radius: 8px;
    background: #f7f8fa;
}

.catalog-page--accessories .catalog-card--accessory + .catalog-card--accessory {
    margin-top: 0;
}

.catalog-page--accessories .catalog-card--accessory:hover,
.catalog-page--accessories .catalog-card--accessory:focus-within {
    z-index: 3;
}

.catalog-page--accessories .catalog-card--accessory .catalog-card__media,
.catalog-page--accessories .catalog-card--accessory .catalog-card__body {
    width: 100%;
}

.catalog-page--accessories .catalog-card--accessory .catalog-card__media {
    grid-column: 1;
    grid-row: 1;
    min-height: 250px;
    overflow: hidden;
    border-radius: 8px 0 0 8px;
    background: #fff;
}

.catalog-page--accessories .catalog-card--accessory .catalog-card__media::before {
    display: none;
}

.tax-product_cat .catalog-page--accessories .catalog-card__image {
    position: static;
    width: 100%;
    height: 250px;
    padding: 24px;
    object-fit: contain;
}

.catalog-page--accessories .catalog-card--accessory .catalog-card__body {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-start;
}

.catalog-page--accessories .catalog-card--accessory .catalog-card__content {
    align-items: flex-start;
    padding: clamp(28px, 3vw, 48px);
    text-align: left;
}

.catalog-page--accessories .catalog-card--accessory .catalog-card__title {
    margin-bottom: 12px;
    font-size: clamp(24px, 2.2vw, 36px);
    line-height: 1.2;
}

.catalog-page--accessories .catalog-card--accessory .catalog-card__description {
    max-width: 760px;
    margin-bottom: 24px;
    font-size: 16px;
    letter-spacing: -0.02em;
    line-height: 1.55;
}

.catalog-page--accessories .catalog-card__commerce {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin-bottom: 24px;
}

.catalog-page--accessories .catalog-card__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    color: #111318;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1;
}

.catalog-card__price ins {
    order: 1;
    text-decoration: none;
}

.catalog-page--accessories .catalog-card__price del {
    order: 2;
    color: #979b9f;
    font-size: 14px;
    font-weight: 400;
}

.catalog-card__price .woocommerce-Price-currencySymbol {
    display: inline-block;
    width: 0.62em;
    height: 0.74em;
    overflow: hidden;
    background: currentColor;
    vertical-align: -0.02em;
    text-indent: 100%;
    white-space: nowrap;
    -webkit-mask: url("../../../img/currency-ruble-semibold.svg") center / contain no-repeat;
    mask: url("../../../img/currency-ruble-semibold.svg") center / contain no-repeat;
}

.catalog-card__price del .woocommerce-Price-currencySymbol {
    -webkit-mask-image: url("../../../img/currency-ruble-regular.svg");
    mask-image: url("../../../img/currency-ruble-regular.svg");
}

.catalog-page--accessories .catalog-card__stock {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #17854f;
    font-size: 14px;
    line-height: 1.2;
}

.catalog-page--accessories .catalog-card__stock::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.catalog-page--accessories .catalog-card__stock--outofstock {
    color: #c74646;
}

.catalog-page--accessories .catalog-card__stock--onbackorder {
    color: #c27a11;
}

.catalog-page--accessories .catalog-card--accessory .catalog-card__actions {
    margin-inline: 0;
    margin-top: auto;
}

@media (min-width: 768px) {
    .catalog-page--accessories .catalog-card--without-description .catalog-card__title {
        margin-bottom: 0;
    }

    .catalog-page--accessories .catalog-card--without-description .catalog-card__commerce {
        margin-top: auto;
        margin-bottom: auto;
    }

    .catalog-page--accessories .catalog-card--without-description .catalog-card__actions {
        margin-top: 0;
    }
}

@media (min-width: 1600px) {
    .catalog-card__body {
        flex-basis: 41.66666667%;
        width: 41.66666667%;
    }

    .catalog-card__media {
        flex-basis: 58.33333333%;
        width: 58.33333333%;
    }
}

@media (max-width: 767px) {
    .catalog-page__title {
        margin-bottom: var(--catalog-space-xl);
    }

    body.term-videoregistratory .catalog-page__title {
        font-size: min(38px, 9vw);
    }

    .catalog-card,
    .catalog-card:nth-child(odd) {
        flex-direction: column;
    }

    .catalog-card__body,
    .catalog-card__media {
        flex-basis: 100%;
        width: 100%;
    }

    .catalog-card__media {
        order: 1;
    }

    .catalog-card__body {
        order: 2;
    }

    .catalog-card__content {
        padding: var(--catalog-space-xl) 0;
    }

    .catalog-card__price--device {
        font-size: 24px;
    }

    .catalog-card__button {
        width: auto;
        min-width: 0;
        height: 30px;
        padding: 0 10px;
        font-size: var(--catalog-step-n2);
    }

    .catalog-buy-menu {
        width: auto;
        min-width: 0;
    }

    .catalog-buy-menu .catalog-card__button {
        width: 100%;
    }

    .catalog-buy-menu__popover {
        top: -6px;
        left: -6px;
        width: calc(100% + 12px);
        min-width: 174px;
        padding: 42px 6px 6px;
        border-radius: 22px;
    }

    .catalog-buy-menu__option {
        width: 100%;
        max-width: 186px;
    }

    .catalog-page--accessories .catalog-list {
        gap: 16px;
    }

    .catalog-page--accessories,
    .catalog-page--devices {
        padding-top: 24px;
    }

    .catalog-page--accessories {
        padding-bottom: 60px;
    }

    .catalog-page--accessories .catalog-page__title,
    .catalog-page--devices .catalog-page__title {
        margin-top: 30px;
        font-size: 38px;
    }

    .catalog-page--accessories .catalog-page__title {
        margin-bottom: 30px;
    }

    .catalog-page--accessories .catalog-card--accessory,
    .catalog-page--accessories .catalog-card--accessory:nth-child(odd) {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        min-height: 0;
        border-radius: 8px;
    }

    .catalog-page--accessories .catalog-card--accessory .catalog-card__media,
    .catalog-page--accessories .catalog-card--accessory .catalog-card__body {
        flex: 0 0 auto;
    }

    .catalog-page--accessories .catalog-card--accessory .catalog-card__media {
        min-height: 210px;
        border-radius: 8px 8px 0 0;
    }

    .tax-product_cat .catalog-page--accessories .catalog-card__image {
        height: 210px;
        padding: 20px;
    }

    .catalog-page--accessories .catalog-card--accessory .catalog-card__content {
        align-items: stretch;
        padding: 24px 20px 26px;
        text-align: left;
    }

    .catalog-page--accessories .catalog-card--accessory .catalog-card__title {
        font-size: 24px;
    }

    .catalog-page--accessories .catalog-card--accessory .catalog-card__description {
        font-size: 15px;
    }

    .catalog-page--accessories .catalog-card--without-description .catalog-card__title {
        margin-bottom: 24px;
    }

}
