@charset "utf-8";

/**
 * 최근 본 차량 모달 — 최상위 스코프 .recent-viewed
 */

.recent-viewed {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.recent-viewed.is-open {
    display: flex;
}

.recent-viewed__dim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.recent-viewed__box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 56.25rem;
    max-height: 90vh;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.recent-viewed__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    padding: 1rem 1.125rem;
    border-bottom: 1px solid #eee;
}

.recent-viewed__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #111;
    line-height: 1.35;
}

.recent-viewed__close {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.75rem;
    line-height: 1;
    color: #333;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.recent-viewed__close:hover {
    opacity: 0.65;
}

.recent-viewed__close:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.recent-viewed__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.recent-viewed__empty {
    margin: 0;
    padding: 3rem 1.25rem;
    text-align: center;
    font-size: 0.9375rem;
    color: #888;
    line-height: 1.5;
}

.recent-viewed__empty[hidden] {
    display: none !important;
}

.recent-viewed__notice {
    margin: 0 0 1rem;
    padding: 0.875rem 1rem;
    background: #f9f9f9;
    border-radius: 0.5rem;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.recent-viewed__notice[hidden] {
    display: none !important;
}

.recent-viewed__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-viewed__item {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid #eee;
    position: relative;
}

.recent-viewed__item:last-child {
    border-bottom: none;
}

.recent-viewed__row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0.25rem 1rem 1rem;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.recent-viewed__row-main:hover .recent-viewed__name {
    color: var(--primary, #e63946);
}

.recent-viewed__thumb-wrap {
    flex-shrink: 0;
    width: 10rem;
    max-width: 32%;
    aspect-ratio: 4 / 3;
    border-radius: 0.375rem;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recent-viewed__thumb-wrap img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.recent-viewed__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding-top: 0.125rem;
}

.recent-viewed__name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.recent-viewed__meta {
    margin: 0;
    font-size: 0.8125rem;
    color: #777;
    line-height: 1.45;
}

.recent-viewed__price-block {
    margin: 0.25rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.recent-viewed__price-block > .recent-viewed__price {
    margin: 0;
}

.recent-viewed__price {
    margin: 0.25rem 0 0;
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    line-height: 1.45;
    white-space: pre-line;
}

.recent-viewed .recent-viewed__price em {
    margin-right: 0.25rem;
    font-size: 0.85em;
    font-style: normal;
    font-weight: 600;
    color: inherit;
}

.recent-viewed__remove {
    flex-shrink: 0;
    align-self: flex-start;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0.75rem 0.75rem 0 0;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    color: #999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.recent-viewed__remove:hover {
    color: #111;
}

.recent-viewed__remove:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

/* 퀵메뉴 — 헤더를 링크로 두었을 때 레이아웃 유지 */
.quick-side-menu a.quick-recent-head {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

@media (max-width: 640px) {

    .recent-viewed__box {
        max-height: 92vh;
        border-radius: 0.5rem;
    }

    .recent-viewed__header {
        padding: 0.875rem 1rem;
    }

    .recent-viewed__title {
        font-size: 1rem;
    }

    .recent-viewed__row-main {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.875rem 0.25rem 0.875rem 0.875rem;
    }

    .recent-viewed__thumb-wrap {
        width: 100%;
        max-width: none;
        aspect-ratio: 16 / 9;
    }

    .recent-viewed__remove {
        position: absolute;
        top: 0.5rem;
        right: 0.25rem;
        margin: 0;
    }
}
