/**
 * Components CSS
 * Загальні стилі для повторюваних компонентів сайту
 */

/* ============================================
   COOKIE NOTICE
   ============================================ */
.cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: rgba(15, 17, 21, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 24px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.cookie-notice.is-visible {
    transform: translateY(0);
}

.cookie-notice__container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.cookie-notice__text {
    font-family: "Exo 2", "Nunito", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.cookie-notice__link {
    color: #008FFF;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.cookie-notice__link:hover {
    color: #0077d6;
}

.cookie-notice__btn {
    flex-shrink: 0;
    padding: 12px 32px;
    border-radius: 8px;
    background: #008FFF;
    color: #fff;
    font-family: "Exo 2", "Nunito", sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 143, 255, 0.3);
}

.cookie-notice__btn:hover {
    background: #0077d6;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 143, 255, 0.4);
}

.cookie-notice__btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 143, 255, 0.3);
}

@media (max-width: 768px) {
    .cookie-notice {
        padding: 16px 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .cookie-notice__container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        text-align: center;
    }
    
    .cookie-notice__text {
        font-size: 12px;
        line-height: 1.4;
        text-align: center;
    }

    .cookie-notice__btn {
        width: 100%;
        text-align: center;
        padding: 12px 24px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cookie-notice {
        padding: 12px 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .cookie-notice__container {
        gap: 10px;
    }
    
    .cookie-notice__text {
        font-size: 11px;
    }

    .cookie-notice__btn {
        padding: 10px 20px;
        font-size: 12px;
    }
}

/* ============================================
   GRECAPTCHA BADGE
   ============================================ */
.grecaptcha-badge {
    display: none !important;
}

/* ============================================
   PAGE TRANSITIONS (View Transitions API)
   ============================================ */
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.2s;
    animation-timing-function: ease-out;
}

::view-transition-old(root) {
    animation-name: fade-out;
}

::view-transition-new(root) {
    animation-name: fade-in;
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Fallback for browsers without View Transitions */
html {
    scroll-behavior: smooth;
}

body {
    opacity: 1;
    transition: opacity 0.15s ease-out;
}

body.page-transitioning {
    opacity: 0;
}

/* ============================================
   LEAD CTA
   ============================================ */
.lead-action-card {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(0, 143, 255, 0.28);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(0, 143, 255, 0.16), rgba(18, 22, 30, 0.92));
    color: #fff;
    font-family: "Exo 2", "Nunito", sans-serif;
}

.lead-action-card__eyebrow {
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lead-action-card__title {
    margin: 0;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

.lead-action-card__text {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.45;
}

.lead-action-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.lead-action-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid #008FFF;
    border-radius: 8px;
    background: #008FFF;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.lead-action-card__btn:hover {
    background: #0077d6;
    border-color: #0077d6;
    color: #fff;
    transform: translateY(-1px);
}

.lead-action-card__btn--secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.22);
}

.lead-action-card__btn--secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.34);
}

.sticky-mobile-cta {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 115;
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(11, 15, 21, 0.94);
    box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sticky-mobile-cta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 46px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #008FFF;
    color: #fff;
    font-family: "Exo 2", "Nunito", sans-serif;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}

.sticky-mobile-cta__btn--secondary {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    body:has(.sticky-mobile-cta) {
        padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    }

    .lead-action-card {
        padding: 16px;
    }

    .lead-action-card__title {
        font-size: 19px;
    }

    .lead-action-card__actions {
        flex-direction: column;
    }

    .lead-action-card__btn {
        width: 100%;
    }

    .sticky-mobile-cta {
        display: grid;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
}

/* Mobile: fixed header sat on top of page content (app css sets .main margin-top to 0 below 900px) */
@media screen and (max-width: 900px) {
    body:has(.site-header__mobile-menu) {
        padding-top: 58px;
    }
}

/* CARFAX Advantage Dealer в подвале. Логотип сайта в подвале - 36 px,
   значок держим меньше. */
.site-footer__carfax {
    display: inline-block;
    height: 32px;
    width: auto;
    margin: 0 0 16px;
}

/* Mobile: на страницах подбора авто строка сортировки не переносилась и
   вылезала за ширину экрана. Двойной класс перебивает инлайновые стили
   страницы - они подключаются после этого файла. */
@media screen and (max-width: 900px) {
    .auctions-results-header .auctions-results-count {
        flex: 1 1 auto;
        min-width: 0;
    }

    .auctions-results-header .auctions-results-sort {
        flex-wrap: wrap;
        gap: 10px;
        min-width: 0;
        max-width: 100%;
    }

    .auctions-results-header .auctions-results-sort__select {
        flex: 1 1 150px;
        min-width: 0;
        max-width: 100%;
    }

    .auctions-results-header .auctions-results-view {
        flex-shrink: 0;
        margin-left: auto;
    }
}

@media screen and (max-width: 480px) {
    .auctions-results-header .auctions-results-sort__label {
        order: 1;
        font-size: 12px;
    }

    .auctions-results-header .auctions-results-view {
        order: 2;
    }

    .auctions-results-header .auctions-results-sort__select {
        order: 3;
        flex-basis: 100%;
        padding: 9px 32px 9px 12px;
        font-size: 12px;
    }

    .auctions-results-header .auctions-results-view__btn {
        width: 34px;
        height: 34px;
    }
}

/* ============================================
   ФОРМЫ ВХОДА И РЕГИСТРАЦИИ
   На десктопе карточка рисовалась декоративной PNG-рамкой,
   из-за чего заголовок выходил за её границы. Плохая рамка
   заменена тем же плоским вариантом, что и на мобильных.
   ============================================ */
.login-form {
    background-image: none !important;
    background-color: rgba(217, 217, 217, 0.08);
    border: unset;
    border-radius: 16px;
    padding: 26px 32px 30px;
    margin: 0 auto 40px;
}

.login-form__title {
    text-align: center;
    margin: 0 0 6px;
    font-size: 24px;
}


/* Вторую форму (новый пароль) нужно уметь скрывать: display:flex перебивает hidden. */
.login-form[hidden] {
    display: none;
}
