/* ===== Б/У техника — Лента ===== */

.used-page .section-title p {
    color: #6b6b6b;
    font-size: 16px;
    margin-top: 8px;
}

/* ===== Информационный баннер ===== */
.used-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: var(--primary-black);
    border-radius: 10px;
    padding: 24px 28px;
    margin-bottom: 24px;
    text-decoration: none;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.used-banner:hover {
    opacity: 0.92;
}

.used-banner__icon-wrap {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    background-color: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.used-banner__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    min-width: 0;
}

.used-banner__title {
    font-weight: var(--font-bold);
    font-size: 15px;
    color: #ffffff;
    line-height: 1.3;
}

.used-banner__subtitle {
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.55);
}

.used-banner__arrow {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.2s ease;
}

.used-banner:hover .used-banner__arrow {
    transform: translateX(3px);
}

/* ===== Сетка карточек ===== */
.used-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

/* ===== Карточка ===== */
.used-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}


/* ===== Проданный товар ===== */
.used-card--sold {
    opacity: 0.7;
}

.used-card--sold .used-card__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* ===== Медиа-блок ===== */
.used-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: var(--light);
}

.used-card__media img,
.used-card__media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Бейдж «Продано» */
.used-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: #e53935;
    color: var(--white);
    font-weight: var(--font-bold);
    font-size: 12px;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 6px;
    z-index: 2;
    letter-spacing: 0.5px;
}

/* Внешнее видео (>20MB, открывается в Telegram) */
.used-card__video-ext {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.used-card__video-ext img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.used-card__play-tg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    z-index: 2;
}

.used-card__video-ext:hover .used-card__play-tg {
    background-color: #0088cc;
}

.used-card__video-label {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--white);
    font-weight: var(--font-semi-bold);
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 2;
}

/* Кнопка Play */
.used-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.3s;
    z-index: 2;
    border: none;
    padding: 0;
}

.used-card__play:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.used-card__play.is-playing {
    background-color: rgba(0, 0, 0, 0.35);
}

/* Спиннер загрузки видео */
.used-card__play.is-loading svg {
    display: none;
}

.used-card__play.is-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: used-spin 0.8s linear infinite;
}

@keyframes used-spin {
    to { transform: rotate(360deg); }
}

/* Счётчик фото */
.used-card__count {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--white);
    font-weight: var(--font-semi-bold);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 2;
}

/* Заглушка без фото */
.used-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e8e8e8;
    color: var(--gray);
    font-size: 14px;
    font-weight: var(--font-semi-bold);
}

/* ===== Контент карточки ===== */
.used-card__content {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.used-card__title {
    font-weight: var(--font-bold);
    font-size: 20px;
    line-height: 25px;
    color: var(--primary-black);
}

.used-card__desc {
    position: relative;
    display: block;
    font-size: 14px;
    line-height: 15px;
    color: #6b6b6b;
    font-weight: var(--font-semi-bold);
    margin-top: 10px;
    margin-bottom: 12px;
}

/* ===== Подвал карточки ===== */
.used-card__footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid #ebebeb;
    gap: 15px;
}

.used-card__footer-left {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
}

.used-card__battery {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: var(--font-semi-bold);
    font-size: 13px;
    color: #6b6b6b;
}

.used-card__price {
    position: relative;
    display: block;
    font-weight: var(--font-bold);
    font-size: 28px;
    color: var(--primary-black);
}

.used-card__price--sold {
    color: #e53935;
    font-size: 14px;
    text-transform: uppercase;
}

/* Ссылка на Telegram */
.used-card__tg-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--light);
    color: #6b6b6b;
    transition: background-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.used-card__tg-link:hover {
    background-color: #0088cc;
    color: var(--white);
}

/* ===== Пустое состояние ===== */
.used-empty {
    text-align: center;
    padding: 80px 20px;
    background-color: var(--white);
    border-radius: 10px;
}

.used-empty p {
    font-size: 16px;
    color: #6b6b6b;
}

/* ===== Лайтбокс ===== */
.used-lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.used-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.used-lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 30px;
    cursor: pointer;
    z-index: 1001;
}

.used-lightbox__img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.used-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.used-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.35);
}

.used-lightbox__nav--prev {
    left: 20px;
}

.used-lightbox__nav--next {
    right: 20px;
}

/* ===== Адаптив ===== */
@media (max-width: 991.98px) {
    .used-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .used-card__content {
        padding: 15px 16px 16px;
    }

    .used-card__title {
        font-size: 15px;
        line-height: 20px;
    }

    .used-card__desc {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }

    .used-card__price {
        font-size: 16px;
    }
}

@media (max-width: 630px) {
    .used-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .used-card__media {
        aspect-ratio: 4 / 3;
    }

    .used-banner {
        padding: 18px 20px;
        gap: 14px;
    }

    .used-banner__icon-wrap {
        width: 36px;
        height: 36px;
    }

    .used-banner__icon-wrap svg {
        width: 18px;
        height: 18px;
    }

    .used-banner__arrow {
        display: none;
    }

    .used-banner__title {
        font-size: 14px;
    }

    .used-banner__subtitle {
        font-size: 12px;
    }
}
