
/* Маркетинговое оформление цен каталога */

.catalog-card__prices {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    min-width: 0;
}

.catalog-card__old-price-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.catalog-card__prices .catalog-card__old-price-row del {
    margin: 0;
    font-size: 15px;
    color: #934000;
    white-space: nowrap;
    font-weight: 750;
}

.catalog-card__discount-percent {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    background: #e8f8ef;
    color: #087d44;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.catalog-card__prices .catalog-card__current-price {
    color: #0134ff;
    font-size: clamp(24px, 1.8vw, 32px);
    font-weight: 750;
    line-height: 1.1;
    white-space: nowrap;
}

.catalog-card__discount-saving {
    margin-top: 5px;
    color: #087d44;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

@media (max-width: 767px) {
    .catalog-card__prices {
        align-items: flex-start;
        text-align: left;
        gap: 6px;
    }

    .catalog-card__old-price-row {
        justify-content: flex-start;
    }

    .catalog-card__prices .catalog-card__current-price {
        font-size: clamp(28px, 7vw, 36px);
    }

    .catalog-card__discount-saving {
        font-size: 14px;
    }
}

/* =============================================
   КАРТОЧКА КАТАЛОГА — МИНИ-ГАЛЕРЕЯ
============================================= */

.catalog-card__media {
    isolation: isolate;
}

.catalog-card__gallery-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.catalog-card__image-discount {
    position: absolute;
    z-index: 3;
    top: 12px;
    left: 12px;

    padding: 7px 11px;
    border-radius: 9px;

    background: #087d44;
    color: #fff;

    font-size: 15px;
    font-weight: 750;
    line-height: 1.2;

    box-shadow: 0 3px 12px rgba(0,0,0,.14);
    pointer-events: none;
}

.catalog-card__gallery-nav {
    position: absolute;
    z-index: 4;
    top: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    padding: 0;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 50%;

    background: rgba(17,24,39,.58);
    color: #fff;

    cursor: pointer;
    transform: translateY(-50%);

    opacity: 0;
    transition: opacity .2s, background .2s;
}

.catalog-card__gallery-nav--prev {
    left: 10px;
}

.catalog-card__gallery-nav--next {
    right: 10px;
}

.catalog-card__gallery-nav span {
    width: 9px;
    height: 9px;

    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.catalog-card__gallery-nav--prev span {
    transform: rotate(-135deg);
    margin-left: 4px;
}

.catalog-card__gallery-nav--next span {
    transform: rotate(45deg);
    margin-right: 4px;
}

.catalog-card:hover .catalog-card__gallery-nav,
.catalog-card__gallery-nav:focus-visible {
    opacity: 1;
}

.catalog-card__gallery-nav:hover {
    background: rgba(17,24,39,.85);
}

.catalog-card__gallery-counter {
    position: absolute;
    z-index: 3;

    bottom: 12px;
    left: 50%;

    padding: 5px 10px;
    border-radius: 20px;

    background: rgba(17,24,39,.65);
    color: #fff;

    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;

    transform: translateX(-50%);
    pointer-events: none;
}

/* =============================================
   КНОПКА ПОДРОБНЕЕ
============================================= */

.catalog-card__actions {
    width: 100%;
    align-items: center;
    justify-content: flex-end;
}

.catalog-card__details-button {
    position: relative;
    z-index: 3;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;
    min-height: 42px;
    padding: 0 13px;

    border-radius: 11px;

    background: #0134ff;
    color: #fff !important;

    font-size: 13px;
    font-weight: 650;
    text-decoration: none !important;
    white-space: nowrap;

    transition: background .2s ease, transform .2s ease;
}

.catalog-card__details-button:hover {
    background: #0027c4;
    transform: translateY(-1px);
}

.catalog-card__details-button:focus-visible {
    outline: 3px solid rgba(1,52,255,.3);
    outline-offset: 3px;
}

.catalog-card__details-button span {
    font-size: 17px;
    line-height: 1;
}

/* Сохраняем доступность сердечка */
.catalog-card__action[data-asset-favorite] {
    z-index: 3;
}

/* =============================================
   МОБИЛЬНАЯ ВЕРСИЯ
============================================= */

@media (max-width: 767px) {
    .catalog-card__gallery-nav {
        opacity: 1;
        width: 34px;
        height: 34px;
    }

    .catalog-card__image-discount {
        top: 10px;
        left: 10px;
        font-size: 14px;
    }

    .catalog-card__info {
        padding-bottom: 8px;
    }

    .catalog-card__usage {
        gap: 10px;
    }

    .catalog-card__offer {
        align-items: stretch;
        text-align: left;
    }

    .catalog-card__actions {
        margin-top: 14px;
        justify-content: space-between;
    }

    .catalog-card__details-button {
        flex: 1;
        min-height: 44px;
        font-size: 14px;
    }
}

@media (hover: none) {
    .catalog-card__gallery-nav {
        opacity: 1;
    }
}

/* ==============================================
   FIX: ГАЛЕРЕЯ, ЦЕНЫ И КНОПКИ КАТАЛОГА
============================================== */

/*
 * Не создаём отдельный stacking context.
 * Иначе невидимая ссылка всей карточки
 * перекрывает стрелки галереи.
 */
.catalog-card__media {
    isolation: auto;
    z-index: auto;
}

.catalog-card__gallery-nav {
    z-index: 5;
    pointer-events: auto;
}

/* Разделяем цену и действия */
.catalog-card__offer {
    min-width: 0;
    gap: 18px;
}

.catalog-card__prices {
    width: 100%;
    min-width: 0;
}

.catalog-card__discount-saving {
    display: block;
    white-space: nowrap;
}

.catalog-card__actions {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
}

.catalog-card__details-button {
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .catalog-card__offer {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        padding: 18px;
        text-align: left;
    }

    .catalog-card__prices {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 6px;
    }

    .catalog-card__old-price-row {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .catalog-card__prices .catalog-card__current-price {
        font-size: clamp(27px, 7vw, 36px);
        line-height: 1.15;
        white-space: nowrap;
    }

    .catalog-card__discount-saving {
        margin-top: 6px;
        font-size: 14px;
        white-space: nowrap;
    }

    .catalog-card__actions {
        display: flex;
        position: relative;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-width: 0;
        gap: 12px;
        margin-top: 0;
    }

    .catalog-card__details-button {
        flex: 1 1 auto;
        min-width: 0;
        min-height: 46px;
    }

    .catalog-card__action[data-asset-favorite] {
        flex: 0 0 42px;
    }
}

@media (max-width: 360px) {
    .catalog-card__prices .catalog-card__current-price {
        font-size: 26px;
    }

    .catalog-card__discount-saving {
        font-size: 12px;
    }
}
