/* ================================================================
   Блок «Скидки» на главной (home.html, section.sale).
   Виден только во время акции. Переменные --bg, --text, --accent,
   --border — из nav.css.
   ================================================================ */

.sale {
    padding: 72px 20px 24px;
    background: var(--bg);
    color: var(--text);
    font-family: 'Manrope', sans-serif;
}

.sale__inner {
    max-width: 1120px;
    margin: 0 auto;
}

/* ===== Шапка ===== */

.sale__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 32px;
    margin-bottom: 36px;
}

.sale__eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.sale__title {
    margin: 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 600;
    line-height: 1;
}

.sale__max {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0;
}

.sale__max-value {
    color: #f87171;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(44px, 6vw, 64px);
    font-weight: 600;
    line-height: 1;
}

.sale__max-label {
    max-width: 90px;
    color: #9ca3af;
    font-size: 13px;
    line-height: 1.3;
}

/* ===== Карточки ===== */

.sale__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.sale-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.sale-card:hover {
    transform: translateY(-3px);
    border-color: rgba(165, 180, 252, 0.35);
}

.sale-card__media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1e222b, #12141a);
}

.sale-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.sale-card:hover .sale-card__media img {
    transform: scale(1.03);
}

/* Ленточка с процентом в правом верхнем углу */
.sale-card__ribbon {
    position: absolute;
    top: 22px;
    right: -42px;
    width: 160px;
    padding: 6px 0;
    background: #ef4444;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    transform: rotate(45deg);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.sale-card__badge {
    position: absolute;
    left: 14px;
    bottom: 14px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    background: rgba(15, 17, 21, 0.75);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sale-card__body {
    display: flex;
    flex: 1;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 22px;
}

.sale-card__title {
    margin: 0 0 6px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.1;
}

.sale-card__title a {
    color: inherit;
    text-decoration: none;
}

.sale-card__title a:focus-visible,
.sale-card__media:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.sale-card__tagline {
    margin: 0;
    color: #9ca3af;
    font-size: 14px;
    line-height: 1.45;
}

.sale-card__buy {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 14px;
}

.sale-card__prices {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin: 0;
    line-height: 1.15;
}

.sale-card__old {
    color: #9ca3af;
    font-size: 13px;
}

.sale-card__new {
    font-size: 22px;
    font-weight: 700;
    white-space: nowrap;
}

/* ===== Ссылка на страницу акции (главная) ===== */

.sale__more {
    margin: 24px 0 0;
    text-align: right;
}

.sale__more a {
    color: var(--accent);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.sale__more a:hover {
    text-decoration: underline;
}

.sale__more a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ===== Страница акции /sale/{slug} ===== */

/* Как body в courses-list.css; через класс — sale.css подключён и на главной */
.sale-body {
    margin: 0;
    overflow-x: clip;
    background: var(--bg);
    color: var(--text);
    font-family: 'Manrope', sans-serif;
}

.sale-page {
    min-height: 70vh;
    padding-top: calc(var(--nav-height) + 40px);
    padding-bottom: 80px;
}

.sale__notice {
    max-width: 620px;
    margin: 0;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    color: #c7cad1;
    font-size: 16px;
    line-height: 1.6;
}

.sale__notice p {
    margin: 0 0 20px;
}

/* ===== Адаптив ===== */

@media (max-width: 860px) {
    .sale__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .sale {
        padding-top: 56px;
    }

    .sale-card__body {
        flex-direction: column;
        align-items: stretch;
    }

    .sale-card__buy {
        justify-content: space-between;
    }

    .sale-card__prices {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sale-card,
    .sale-card__media img {
        transition: none;
    }

    .sale-card:hover,
    .sale-card:hover .sale-card__media img {
        transform: none;
    }
}
