/* 차량 비교 — 카드 담기 버튼 + 플로팅 비교함 (전 사이트 공통) */
.epc-cmp-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px 6px 8px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #4b5160;
    font-size: 11.5px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Roboto, sans-serif;
    box-shadow: 0 2px 8px rgba(20, 20, 30, 0.16);
    cursor: pointer;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.epc-cmp-toggle:hover {
    transform: translateY(-1px);
}

.epc-cmp-toggle__check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1.6px solid #c7cbd4;
    color: transparent;
    flex: none;
}

.epc-cmp-toggle.is-on {
    background: #1a1d29;
    color: #fff;
}

.epc-cmp-toggle.is-on .epc-cmp-toggle__check {
    border-color: #fff;
    color: #fff;
}

.epc-cmp-toggle--current {
    position: static;
    box-shadow: none;
    background: #eef1f6;
    width: 100%;
    justify-content: center;
    padding: 10px;
    border-radius: 12px;
    font-size: 13px;
}

.epc-cmp-toggle--current.is-on {
    background: #1a1d29;
}

/* 플로팅 비교함 — 사이트별 하단 고정 상담바(z-index 최대 ~100003)보다 항상 위에 노출 */
.epc-cmp-tray {
    position: fixed;
    right: 18px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
    z-index: 999500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Roboto, sans-serif;
    transition: bottom 0.15s ease;
}

.epc-cmp-tray__launcher {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border: none;
    border-radius: 999px;
    background: #1a1d29;
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    box-shadow: 0 10px 26px rgba(20, 20, 30, 0.28);
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px) scale(0.94);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease, background 0.15s ease;
}

.epc-cmp-tray.has-items .epc-cmp-tray__launcher,
.epc-cmp-tray:has([data-cmp-current]) .epc-cmp-tray__launcher {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.epc-cmp-tray__launcher:hover {
    background: #2563eb;
}

.epc-cmp-tray__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff5722;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.epc-cmp-tray__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: 260px;
    max-width: calc(100vw - 36px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(20, 20, 30, 0.22);
    padding: 14px;
    animation: epcCmpPanelIn 0.18s ease;
}

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

.epc-cmp-tray__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.epc-cmp-tray__close {
    border: none;
    background: none;
    font-size: 18px;
    line-height: 1;
    color: #9aa0ac;
    cursor: pointer;
    padding: 2px 4px;
}

.epc-cmp-tray__current {
    margin-bottom: 10px;
}

.epc-cmp-tray__list {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.epc-cmp-tray__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 10px;
    background: #f7f8fa;
}

.epc-cmp-tray__item-thumb {
    width: 40px;
    height: 30px;
    border-radius: 6px;
    overflow: hidden;
    background: #e8eaee;
    flex: none;
}

.epc-cmp-tray__item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.epc-cmp-tray__item-title {
    flex: 1;
    font-size: 12.5px;
    font-weight: 600;
    color: #2c313d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.epc-cmp-tray__item-remove {
    border: none;
    background: none;
    color: #b7bdc9;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    flex: none;
}

.epc-cmp-tray__item-remove:hover {
    color: #ef4444;
}

.epc-cmp-tray__empty {
    text-align: center;
    color: #b7bdc9;
    font-size: 12.5px;
    padding: 14px 0;
}

.epc-cmp-tray__actions {
    display: flex;
    gap: 8px;
}

.epc-cmp-tray__clear {
    flex: none;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.epc-cmp-tray__go {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    padding: 9px 0;
    transition: background 0.15s ease;
}

.epc-cmp-tray__go:hover {
    background: #1d4ed8;
}

.epc-cmp-tray__go.is-disabled {
    background: #d6d9e0;
    color: #9aa0ac;
    cursor: not-allowed;
    pointer-events: none;
}

.epc-cmp-toast {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 26px);
    transform: translate(-50%, 12px);
    z-index: 999600;
    background: #1a1d29;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 11px 18px;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(20, 20, 30, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Roboto, sans-serif;
    max-width: 86vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.epc-cmp-toast.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
}

body.epc-has-bottom-bar .epc-cmp-toast {
    bottom: calc(var(--epc-mo-fixed-bar-h, 92px) + 20px);
}

/* 하단 고정 상담바가 있는 페이지(모바일 스킨 공통 --epc-mo-fixed-bar-h 변수)는 그 위로 띄운다 */
body.epc-has-bottom-bar .epc-cmp-tray {
    bottom: calc(var(--epc-mo-fixed-bar-h, 92px) + 14px);
}

@media (max-width: 480px) {
    .epc-cmp-tray {
        right: 14px;
    }

    body.epc-has-bottom-bar .epc-cmp-tray {
        right: 14px;
        bottom: calc(var(--epc-mo-fixed-bar-h, 92px) + 12px);
    }
}
