.rd-product-card {
    position: relative;
}

.rd-product-card-media {
    position: relative;
}

.rd-product-card-labels {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    pointer-events: none;
}

.rd-product-card-labels .products-view-label-inner {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    letter-spacing: .3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.rd-product-card-labels .products-view-label-best {
    background: #d31700;
}

.rd-product-card-labels .products-view-label-new {
    background: #22a55a;
}

.rd-product-card-labels .products-view-label-discount {
    background: #f5a623;
}

.rd-product-card-labels .products-view-label-sales {
    background: #555;
}

.rd-product-card-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.2;
}

.rd-product-card-price .rd-old-price {
    color: #8a8a8a;
    font-size: 13px;
    font-weight: 400;
    text-decoration: line-through;
}

.rd-product-card-price .rd-new-price {
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 700;
}

.rd-product-card-price .rd-profit {
    color: #f5a623;
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
}

/* Равная высота карточек в каруселях и сетках */
.rd-product-card {
    height: 100%;
}

.rd-product-card-footer {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.rd-product-card-btn {
    margin-top: auto;
}

/* Aside на /productlist/* */
.rd-productlist-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 420px;
    overflow-y: auto;
}
.rd-productlist-filter-item {
    padding: 0;
}
.rd-productlist-filter-item a {
    display: block;
    padding: 8px 12px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    transition: background .12s ease;
}
.rd-productlist-filter-item a:hover {
    background: #f0f4f9;
}
.rd-productlist-filter-item.is-active a {
    background: #1a5fb4;
    color: #fff;
    font-weight: 600;
}

.rd-productlist-filter {
    margin-top: 16px;
}
.rd-productlist-filter .catalog-filter-header.h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #1a1a1a;
}
.rd-productlist-filter .catalog-filter-content {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 4px;
}
.rd-productlist-filter-block {
    border: 0;
    padding: 0;
}
.rd-productlist-filter-block summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
    border-radius: 6px;
}
.rd-productlist-filter-block summary::-webkit-details-marker { display: none; }
.rd-productlist-filter-block summary:hover { background: #f7f8fa; }

/* Стрелка — используем дефолт от commonTemplate.css (mask-image),
   только переопределяем угол поворота для нашего <details> */
.rd-productlist-filter .catalog-filter-block-header::after {
    transform: rotate(0deg) !important;
    transition: transform .2s ease;
}
.rd-productlist-filter-block[open] > summary.catalog-filter-block-header::after {
    transform: rotate(180deg) !important;
}

.rd-productlist-filter-block .catalog-filter-block-content {
    padding: 4px 8px 8px;
}

/* Стилизованный скроллбар фильтра */
.rd-productlist-filter-list {
    scrollbar-width: thin;
    scrollbar-color: #c4cdd9 transparent;
}
.rd-productlist-filter-list::-webkit-scrollbar {
    width: 6px;
}
.rd-productlist-filter-list::-webkit-scrollbar-track {
    background: transparent;
}
.rd-productlist-filter-list::-webkit-scrollbar-thumb {
    background: #c4cdd9;
    border-radius: 3px;
}
.rd-productlist-filter-list::-webkit-scrollbar-thumb:hover {
    background: #1a5fb4;
}

/* Категории на странице поиска */
.rd-search-section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 22px 0 12px;
    color: #1a1a1a;
}
.rd-search-cats {
    margin-top: 14px;
    margin-bottom: 24px;
}
.rd-search-cats-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}
.rd-search-cats-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 500;
    line-height: 1.3;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.rd-search-cats-list a:hover {
    border-color: #1a5fb4;
    background: #f4f7fb;
    color: #1a5fb4;
}
.rd-search-cat-name {
    flex: 1;
    font-size: 13px;
}
.rd-search-cat-count {
    background: #eef1f6;
    color: #5a6b80;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.rd-search-cats-list a:hover .rd-search-cat-count {
    background: #1a5fb4;
    color: #fff;
}

/* Атрибуты в сайдбаре фильтров */
.rd-productlist-filter-block .rd-attr-values {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c4cdd9 transparent;
}
.rd-productlist-filter-block .rd-attr-values::-webkit-scrollbar { width: 6px; }
.rd-productlist-filter-block .rd-attr-values::-webkit-scrollbar-thumb { background: #c4cdd9; border-radius: 3px; }
.rd-productlist-filter-block .rd-attr-values li a {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 12px;
    border-radius: 4px;
}
.rd-productlist-filter-block .rd-attr-values li a:hover { background: #f0f4f9; }
.rd-productlist-filter-block .rd-attr-values li.is-active a { background: #1a5fb4; color: #fff; font-weight: 600; }
.rd-attr-count { color: #8a8a8a; font-size: 11px; }
.rd-productlist-filter-block .rd-attr-values li.is-active .rd-attr-count { color: rgba(255,255,255,.85); }

/* Мобильная кнопка фильтров (по умолчанию скрыта на desktop) */
.rd-mobile-filter-btn { display: none; }
.rd-mobile-aside-backdrop { display: none; }
.rd-mobile-aside-close { display: none; }

@media (max-width: 991px) {
    .rd-mobile-filter-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 12px 18px;
        background: #1a5fb4;
        color: #fff;
        border: 0;
        border-radius: 6px;
        font-weight: 600;
        font-size: 14px;
        cursor: pointer;
        margin: 0 0 14px;
    }
    .rd-mobile-filter-btn:hover { background: #154f93; }

    .body-content > .site-body-aside,
    .body-content > .col-xs-3.site-body-aside,
    body > .rd-mobile-aside-portal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 88%;
        max-width: 360px;
        height: 100%;
        background: #fff;
        z-index: 999999;
        overflow-y: auto;
        padding: 56px 16px 20px;
        box-shadow: 2px 0 24px rgba(0, 0, 0, .25);
        transform: translateX(-100%);
        transition: transform .25s ease;
        margin: 0;
    }
    .body-content > .site-body-aside.is-open,
    .body-content > .col-xs-3.site-body-aside.is-open,
    body > .rd-mobile-aside-portal.is-open {
        display: block;
        transform: translateX(0);
    }

    .rd-mobile-aside-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        background: transparent;
        border: 0;
        border-radius: 50%;
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
        color: #1a1a1a;
        z-index: 2;
    }
    .rd-mobile-aside-close:hover { background: #f3f3f3; }

    .rd-mobile-aside-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(20, 20, 20, .5);
        z-index: 99990;
    }
    .rd-mobile-aside-backdrop.is-open { display: block; }
}

.rd-quickview-trigger {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #1a1a1a;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .2s ease, transform .2s ease, background .15s ease;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
}

.rd-product-card:hover .rd-quickview-trigger,
.rd-quickview-trigger:focus-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (hover: none), (max-width: 991px) {
    .rd-quickview-trigger {
        opacity: 1;
        transform: translateY(0);
    }
}

.rd-quickview-trigger:hover {
    background: #fff;
    color: #d31700;
}

.rd-quickview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 20, .55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.rd-quickview-overlay.is-open {
    display: flex;
}

.rd-quickview-dialog {
    background: #fff;
    border-radius: 12px;
    max-width: 920px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.rd-quickview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #555;
}

.rd-quickview-close:hover {
    background: #f3f3f3;
    color: #000;
}

.rd-quickview-loading {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #888;
    font-size: 14px;
}

.rd-qv-grid {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 28px;
    align-items: start;
}

@media (max-width: 720px) {
    .rd-qv-grid {
        grid-template-columns: 1fr;
    }
}

.rd-qv-gallery {
    min-width: 0;
}

.rd-qv-main-photo {
    background: #fafafa;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rd-qv-main-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.rd-qv-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.rd-qv-thumb {
    width: 64px;
    height: 64px;
    padding: 0;
    border: 2px solid transparent;
    background: #fafafa;
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
}

.rd-qv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rd-qv-thumb.is-active {
    border-color: #d31700;
}

.rd-qv-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-right: 18px;
}

.rd-qv-title {
    font-size: 20px;
    line-height: 1.3;
    margin: 0;
    color: #1a1a1a;
}

.rd-qv-sku {
    color: #666;
    font-size: 14px;
}

.rd-qv-price {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.rd-qv-price del {
    color: #999;
    font-weight: 400;
    font-size: 18px;
    margin-right: 6px;
}

.rd-qv-price ins {
    text-decoration: none;
    color: #1a5fb4;
}

.rd-qv-attrs {
    list-style: none;
    margin: 0;
    padding: 12px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.rd-qv-attrs li {
    display: flex;
    gap: 8px;
}

.rd-qv-attr-name {
    color: #888;
    flex-shrink: 0;
    min-width: 80px;
}

.rd-qv-attr-values {
    color: #1a1a1a;
}

.rd-qv-actions {
    display: flex;
    gap: 8px;
}

.rd-qv-add-btn {
    display: inline-block;
    padding: 12px 22px;
    background: #1a5fb4;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background .15s ease;
    cursor: pointer;
}

.rd-qv-add-btn:hover {
    background: #154f93;
    color: #fff;
}

.rd-qv-add-btn--quote {
    background: #555;
}

.rd-qv-add-btn--quote:hover {
    background: #333;
}

.rd-qv-qr {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.rd-qv-qr-canvas {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.rd-qv-qr-canvas img,
.rd-qv-qr-canvas canvas {
    display: block;
}

.rd-qv-qr-caption {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.rd-qv-error {
    text-align: center;
    color: #c00;
    padding: 30px;
}
