/* ===== DrukWideCyr font ===== */
@font-face {
    font-family: 'DrukWideCyr';
    src: url('../fonts/drukwidecyr-bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ===== Trade-In Hero Banner ===== */
/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

.tradein-banner {
    position: relative !important;
    height: 598px !important;
    background: #0d0d1a !important;
    overflow: hidden !important;
    border-radius: 16px !important;
    margin-bottom: 66px !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
}

.tradein-banner__content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px 0 0;
    width: 100%;
}

.tradein-banner__logo {
    margin-top: 24px;
}

.tradein-banner__logo svg {
    width: auto;
    height: 52px;
    display: inline-block;
}

@media (max-width: 768px) {
    .tradein-banner__logo svg { height: 38px; }
}

@media (max-width: 480px) {
    .tradein-banner__logo svg { height: 28px; }
}

.tradein-banner__title {
    font-family: 'DrukWideCyr', 'Impact', sans-serif;
    font-weight: 700;
    font-size: clamp(40px, 9vw, 180px);
    line-height: 0.88;
    color: #ffffff;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    margin: 0 0 20px;
    white-space: nowrap;
    width: 100%;
    text-align: center;
    display: block;
}

.tradein-banner__sub {
    font-size: clamp(14px, 1.5vw, 18px);
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
    margin: 0 0 28px;
    font-weight: 400;
}

.tradein-banner__btn {
    display: inline-block;
    padding: 14px 40px;
    background: #ffffff;
    color: #111111;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    letter-spacing: 0.01em;
}

.tradein-banner__btn:hover {
    background: #f0f0f0;
    color: #111111;
    text-decoration: none;
    transform: translateY(-2px);
}

.tradein-banner__image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: url('../image/tradein-banner.jpg') center center / cover no-repeat;
    z-index: 1;
    pointer-events: none;
}

/* Dark gradient overlay so text is readable */
.tradein-banner__image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(160deg, rgba(0,0,0,0.82) 0%, rgba(15,18,40,0.65) 30%, rgba(56,56,63,0.45) 80%);
    z-index: 2;
}

@media (max-width: 992px) {
    .tradein-banner {
        height: 483px !important;
    }
}

@media (max-width: 768px) {
    .tradein-banner {
        height: 437px !important;
        border-radius: 12px !important;
    }
    .tradein-banner__content {
        padding-top: 32px;
    }
}

@media (max-width: 480px) {
    .tradein-banner {
        height: 391px !important;
        border-radius: 10px !important;
        margin-bottom: 60px !important;
    }
    .tradein-banner__content {
        padding-top: 24px;
    }
    .tradein-banner__btn {
        padding: 12px 28px;
        font-size: 14px;
    }
}

/* ===== Как работает программа ===== */

.tradein-how {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 48px 40px;
    margin-bottom: 48px;
    margin-top: 0;
}

.tradein-how__heading {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 32px;
    line-height: 1.2;
}

.tradein-how__cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.tradein-how__card {
    background: #2a2a2a;
    border-radius: 14px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    transition: background 0.2s;
}

.tradein-how__card:hover {
    background: #333333;
}

.tradein-how__card-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #ffffff;
    color: #1a1a1a;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.tradein-how__card-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px;
    line-height: 1.3;
}

.tradein-how__card-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.65;
    margin: 0;
}

@media (max-width: 900px) {
    .tradein-how {
        padding: 36px 24px;
        border-radius: 14px;
    }
    .tradein-how__cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .tradein-how__heading {
        font-size: 26px;
        margin-bottom: 24px;
    }
}

@media (max-width: 480px) {
    .tradein-how {
        padding: 28px 18px;
        border-radius: 12px;
        margin-bottom: 36px;
    }
    .tradein-how__heading {
        font-size: 22px;
    }
    .tradein-how__card {
        padding: 24px 20px;
        border-radius: 12px;
    }
    .tradein-how__card-title {
        font-size: 18px;
    }
}

/* ===== Trade-In страница ===== */

.tradein-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0 60px;
}

/* Заголовок */
.tradein-hero {
    text-align: center;
    margin-bottom: 40px;
}

.tradein-title {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.tradein-subtitle {
    font-size: 16px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Шаги */
.tradein-steps {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
}

.tradein-steps__heading {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #1a1a1a;
}

.tradein-steps__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .tradein-steps__grid { grid-template-columns: 1fr; }
}

.tradein-step {
    text-align: center;
}

.tradein-step__num {
    width: 48px;
    height: 48px;
    background: #e31e24;
    color: #fff;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.tradein-step__title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.tradein-step__text {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Калькулятор */
.tradein-calc {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 2px 24px rgba(0,0,0,0.06);
}

.tradein-calc__heading {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 32px;
    color: #1a1a1a;
}

.tradein-calc__form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Поле */
.tradein-field {
    padding: 24px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: opacity 0.25s;
}

.tradein-field:last-child {
    border-bottom: none;
}

.tradein-field--locked {
    opacity: 0.38;
    pointer-events: none;
    user-select: none;
}

.tradein-field--unlocked {
    opacity: 1;
    pointer-events: auto;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tradein-field__label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 14px;
}

.tradein-field__label small {
    font-weight: 400;
    color: #999;
    font-size: 13px;
}

.tradein-field__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.tradein-field--locked .tradein-field__num {
    background: #ccc;
}

/* Селект (скрытый нативный) */
.tradein-select-wrap {
    position: relative;
}

.tradein-select {
    display: none;
}

/* ===== Кастомный dropdown ===== */
.ti-dropdown {
    position: relative;
    user-select: none;
}

.ti-dropdown__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-size: 15px;
    color: #1a1a1a;
}

.ti-dropdown__trigger:hover {
    border-color: #c0c0c0;
    background: #fff;
}

.ti-dropdown--open .ti-dropdown__trigger {
    border-color: #1a1a1a;
    background: #fff;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.ti-dropdown__val {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1a1a1a;
}

.ti-dropdown__trigger:has(.ti-dropdown__val:empty) .ti-dropdown__val,
.ti-dropdown--placeholder .ti-dropdown__val {
    color: #aaa;
}

.ti-dropdown__arrow {
    width: 12px;
    height: 8px;
    color: #888;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.ti-dropdown--open .ti-dropdown__arrow {
    transform: rotate(180deg);
    color: #1a1a1a;
}

.ti-dropdown__list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #1a1a1a;
    border-top: none;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 200;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    display: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.ti-dropdown--open .ti-dropdown__list {
    display: block;
}

.ti-dropdown__item {
    padding: 12px 18px;
    font-size: 15px;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.15s;
}

.ti-dropdown__item:hover {
    background: #f5f5f5;
}

.ti-dropdown__item--active {
    font-weight: 600;
    background: #f0f0f0;
}

.ti-dropdown__item--placeholder {
    color: #aaa;
    font-size: 14px;
}

.tradein-field--locked .ti-dropdown__trigger {
    cursor: not-allowed;
    pointer-events: none;
}

/* Опции (радио/чекбокс) */
.tradein-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tradein-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    user-select: none;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: #fafafa;
}

.tradein-option:hover {
    border-color: #1a1a1a;
    background: #fff;
}

.tradein-option input[type="radio"],
.tradein-option input[type="checkbox"] {
    display: none;
}

.tradein-option input:checked + .tradein-option__label {
    color: #1a1a1a;
    font-weight: 700;
}

.tradein-option:has(input:checked) {
    border-color: #1a1a1a;
    background: #fff;
    box-shadow: inset 0 0 0 1px #1a1a1a;
}

.tradein-option__deduction {
    font-size: 12px;
    color: #999;
    margin-left: 4px;
}

/* Результат */
.tradein-result {
    border-bottom: none !important;
}

.tradein-result__inner {
    text-align: center;
    background: #f8f8f8;
    border-radius: 12px;
    padding: 32px;
}

.tradein-result__label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.tradein-result__price {
    font-size: 48px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.tradein-result__zero {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
}

.tradein-result__note {
    font-size: 13px;
    color: #999;
    margin-bottom: 24px;
}

/* Кнопки */
.tradein-btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}

.tradein-btn:active {
    transform: scale(0.98);
}

.tradein-btn--primary {
    background: #1a1a1a;
    color: #fff;
    margin-right: 12px;
    margin-bottom: 12px;
}

.tradein-btn--primary:hover {
    background: #333;
    color: #fff;
}

.tradein-btn--secondary {
    background: #f0f0f0;
    color: #666;
}

.tradein-btn--secondary:hover {
    background: #e0e0e0;
}

.tradein-btn--full {
    width: 100%;
    text-align: center;
}

/* Попап */
.tradein-popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

body.tradein-popup-open {
    overflow: hidden;
}

.tradein-popup {
    background: #fff;
    border-radius: 16px;
    padding: 36px;
    max-width: 480px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.tradein-popup__close {
    position: absolute;
    top: 16px; right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.tradein-popup__close:hover { color: #333; }

.tradein-popup__title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.tradein-popup__device {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #444;
}

.tradein-popup__price {
    color: #e31e24;
    font-weight: 600;
}

/* Форма */
.tradein-form-group {
    margin-bottom: 16px;
}

.tradein-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.tradein-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    color: #1a1a1a;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.tradein-input:focus {
    outline: none;
    border-color: #e31e24;
}

.tradein-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Успех */
.tradein-popup__success {
    text-align: center;
    padding: 20px 0;
}

.tradein-success-icon {
    width: 64px;
    height: 64px;
    background: #28a745;
    color: #fff;
    border-radius: 50%;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.tradein-popup__success h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tradein-popup__success p {
    color: #666;
}

/* Мобильные */
@media (max-width: 576px) {
    .tradein-calc { padding: 20px 16px; }
    .tradein-title { font-size: 26px; }
    .tradein-result__price { font-size: 32px; }
    .tradein-popup { padding: 24px 20px; }
    .tradein-btn { padding: 12px 20px; font-size: 15px; }
    .tradein-options { gap: 8px; }
    .tradein-option { padding: 8px 12px; font-size: 13px; }
}
