/* ===== Trade-In Widget (Extra Service inside product card) ===== */

/* Wrapper */
.ti-widget {
    margin-top: 6px;
}

/* Toggle row — inherits extra-services__item styles */
.extra-services__item--trade-in .extra-services__label {
    font-weight: 500;
}

/* Quiz body — hidden by default, slides open */
.ti-widget__body {
    margin-top: 12px;
    display: none;
}

.ti-widget__body.is-open {
    display: block;
    animation: tiWidgetFadeIn 0.2s ease;
}

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

/* Field */
.ti-widget__field {
    padding: 10px 0;
    border-bottom: 1px solid #e8eef8;
    transition: opacity 0.2s;
}

.ti-widget__field:last-child {
    border-bottom: none;
}

.ti-widget__field--locked {
    opacity: 0.35;
    pointer-events: none;
    user-select: none;
}

.ti-widget__field--unlocked {
    opacity: 1;
    pointer-events: auto;
}

/* Label */
.ti-widget__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.ti-widget__label small {
    font-weight: 400;
    color: #999;
    font-size: 11px;
}

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

.ti-widget__field--locked .ti-widget__num {
    background: #ccc;
}

/* Select wrap */
.ti-widget__select-wrap {
    position: relative;
}

.ti-widget__select {
    display: none;
}

/* Custom dropdown — compact version */
.ti-wd {
    position: relative;
    user-select: none;
}

.ti-wd__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    border: 1.5px solid #dde6f5;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-size: 13px;
    color: #1a1a1a;
}

.ti-wd__trigger:hover {
    border-color: #aac4f0;
    background: #fafcff;
}

.ti-wd--open .ti-wd__trigger {
    border-color: #1a6bff;
    background: #fff;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

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

.ti-wd__placeholder {
    color: #aaa;
}

.ti-wd__arrow {
    width: 10px;
    height: 7px;
    color: #888;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.ti-wd--open .ti-wd__arrow {
    transform: rotate(180deg);
    color: #1a6bff;
}

.ti-wd__list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #1a6bff;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 500;
    margin: 0;
    padding: 2px 0;
    list-style: none;
    display: none;
    box-shadow: 0 6px 18px rgba(26,107,255,0.12);
}

.ti-wd--open .ti-wd__list {
    display: block;
}

.ti-wd__item {
    padding: 9px 14px;
    font-size: 13px;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.12s;
}

.ti-wd__item:hover {
    background: #f0f5ff;
}

.ti-wd__item--active {
    font-weight: 600;
    background: #e8f0ff;
}

.ti-wd__item--placeholder {
    color: #aaa;
    font-size: 12px;
}

/* Options (radio/checkbox) */
.ti-widget__options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ti-widget__option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1.5px solid #dde6f5;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
    font-size: 12px;
    font-weight: 500;
    color: #444;
    background: #fff;
}

.ti-widget__option:hover {
    border-color: #1a6bff;
    background: #f5f8ff;
}

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

.ti-widget__option:has(input:checked) {
    border-color: #1a6bff;
    background: #eef3ff;
    box-shadow: inset 0 0 0 1px #1a6bff;
    color: #1a1a1a;
    font-weight: 600;
}

/* Result */
.ti-widget__result {
    border-bottom: none !important;
}

.ti-widget__result-inner {
    background: #eef3ff;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ti-widget__result-label {
    font-size: 12px;
    color: #555;
    flex: 1;
    min-width: 120px;
}

.ti-widget__result-price {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ti-widget__result-zero {
    font-size: 13px;
    font-weight: 600;
    color: #e55;
    white-space: nowrap;
}

.ti-widget__result-note {
    font-size: 11px;
    color: #999;
    width: 100%;
    margin-top: 4px;
}

/* Reset link */
.ti-widget__reset {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
}

.ti-widget__reset:hover {
    color: #555;
}

/* Cart summary badge */
.ti-widget-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #1a6bff;
    background: #eef3ff;
    border-radius: 6px;
    padding: 4px 10px;
    margin-top: 4px;
}

.ti-widget-summary__icon {
    font-size: 13px;
}

/* Mobile */
@media (max-width: 576px) {
    .ti-widget__result-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .ti-widget__result-price {
        font-size: 20px;
    }
}
