/* ========================================================
   Price Compare (실시간 최저가 비교 & 가성비 계산기) Styles
   ======================================================== */

.price-body {
    background-color: #f8fafc;
    color: #0f172a;
}

.price-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 5rem;
    width: 100%;
    box-sizing: border-box;
}

.price-hero-card {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.04);
    text-align: center;
    margin-bottom: 2rem;
}

.price-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0369a1;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    padding: 0.3rem 0.9rem;
    border-radius: 9999px;
    margin-bottom: 0.85rem;
}

.price-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.price-subtitle {
    font-size: 1.02rem;
    color: #64748b;
    margin-bottom: 1.75rem;
}

/* 검색창 */
.price-search-form {
    display: flex;
    gap: 0.65rem;
    max-width: 680px;
    margin: 0 auto 1.25rem;
}

.price-search-input-wrap {
    position: relative;
    flex: 1;
}

.price-search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
    color: #94a3b8;
    pointer-events: none;
}

.price-search-input {
    width: 100%;
    padding: 0.95rem 1.1rem 0.95rem 2.85rem;
    font-size: 1.05rem;
    font-weight: 500;
    border: 2px solid #cbd5e1;
    border-radius: 0.75rem;
    background: #ffffff;
    color: #0f172a;
    outline: none;
    transition: all 0.2s;
}

.price-search-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.price-search-btn {
    padding: 0.95rem 1.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5 0%, #0284c7 100%);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.2s;
}

.price-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

.price-search-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

/* 추천 키워드 칩 */
.quick-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.quick-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    margin-right: 0.25rem;
}

.keyword-chip {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.keyword-chip:hover {
    background: #eef2ff;
    border-color: #6366f1;
    color: #4f46e5;
}

/* 요약 대시보드 */
.price-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    padding: 1.15rem 1.25rem;
    text-align: left;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.summary-stat-card.highlight-lowest {
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    border-color: #93c5fd;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    display: block;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
}

.summary-stat-card.highlight-lowest .stat-value {
    color: #1d4ed8;
}

/* 정렬 및 툴바 */
.price-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 0.85rem 1.25rem;
    border-radius: 0.85rem;
}

.toolbar-result-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
}

.sort-btn-group {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.sort-btn {
    background: #f1f5f9;
    border: 1px solid transparent;
    color: #475569;
    padding: 0.4rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.sort-btn.active {
    background: #4f46e5;
    color: #ffffff;
}

.sort-btn:hover:not(.active) {
    background: #e2e8f0;
}

/* 상품 리스트 */
.price-results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}

.prod-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.35rem;
    display: grid;
    grid-template-columns: 120px 1fr 310px;
    gap: 1.35rem;
    align-items: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.prod-card:hover {
    border-color: #a5b4fc;
    box-shadow: 0 6px 22px rgba(79, 70, 229, 0.07);
}

.prod-card.lowest-badge-card {
    border: 2px solid #3b82f6;
}

.prod-thumb-wrap {
    width: 120px;
    height: 120px;
    border-radius: 0.75rem;
    border: 1px solid #f1f5f9;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.prod-thumb-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.rank-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(15, 23, 42, 0.8);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
}

.rank-badge.top-rank {
    background: #2563eb;
}

.prod-main-col {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.prod-meta-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: #64748b;
}

.prod-category-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 0.15rem 0.55rem;
    border-radius: 0.35rem;
    font-weight: 600;
}

.prod-rating-badge {
    color: #d97706;
    font-weight: 700;
}

.prod-title-link {
    font-size: 1.12rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    line-height: 1.35;
    display: inline-block;
}

.prod-title-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.prod-spec-text {
    font-size: 0.84rem;
    color: #64748b;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 우측 옵션별 가격 리스트 */
.prod-options-col {
    border-left: 1px solid #f1f5f9;
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.65rem;
    border-radius: 0.5rem;
    background: #f8fafc;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.option-price-row:hover {
    background: #eef2ff;
}

.option-price-row.primary-opt {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.opt-left {
    display: flex;
    flex-direction: column;
}

.opt-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
}

.opt-unit {
    font-size: 0.74rem;
    color: #0284c7;
    font-weight: 600;
}

.opt-right {
    text-align: right;
}

.opt-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    display: block;
}

.option-price-row.primary-opt .opt-price {
    color: #1d4ed8;
    font-size: 1.15rem;
}

.opt-mall {
    font-size: 0.73rem;
    color: #64748b;
}

/* 로딩 스피너 */
.price-loading {
    text-align: center;
    padding: 3.5rem 1rem;
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 4px solid #e2e8f0;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 가성비(단위 가격) 직접 비교 계산기 섹션 */
.unit-calc-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1.15rem;
    padding: 2rem;
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
}

.unit-calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.unit-item-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1.25rem;
}

.unit-item-box.winner {
    background: #ecfdf5;
    border-color: #10b981;
}

.unit-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.winner-badge {
    background: #10b981;
    color: #ffffff;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}

.unit-inputs-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.unit-inputs-row input {
    width: 100%;
    padding: 0.65rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.92rem;
}

.unit-result-text {
    margin-top: 0.85rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

/* 반응형 */
@media (max-width: 860px) {
    .price-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .prod-card {
        grid-template-columns: 90px 1fr;
    }
    .prod-options-col {
        grid-column: 1 / -1;
        border-left: none;
        border-top: 1px solid #f1f5f9;
        padding-left: 0;
        padding-top: 0.85rem;
    }
    .unit-calc-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .price-search-form {
        flex-direction: column;
    }
    .price-title {
        font-size: 1.75rem;
    }
}
