/* =========================================================
   EVCompareHub Compare Category
   Path: /ev/compare-category.css
   ใช้เฉพาะหน้า /ev/compare/{category}/
   ========================================================= */

.compare-category-page {
    background: #ffffff !important;
    color: #111827;
}

/* จำกัดไม่ให้ theme หลักไปทำ link เป็นสีแดง/ขีดเส้นใต้ */
.compare-category-page a,
.compare-category-page a:visited,
.compare-category-page a:hover,
.compare-category-page a:focus {
    text-decoration: none !important;
}

.compare-category-page .portal-main {
    width: 100%;
    padding: 0 0 32px;
    background: #ffffff;
}

.compare-category-page .portal-shell {
    width: 100%;
    max-width: 1480px;
    margin: 16px auto 0;
    padding-left: 12px;
    padding-right: 12px;
}

/* Breadcrumb */
.compare-category-page .portal-breadcrumb {
    margin: 0 0 12px;
    color: #667085;
    font-size: 13px;
}

.compare-category-page .portal-breadcrumb a {
    color: #667085 !important;
    font-weight: 700;
}

.compare-category-page .portal-breadcrumb a:hover {
    color: var(--green-dark) !important;
}

/* Hero ให้ mood ใกล้หน้า portal แต่ compact กว่า */
.compare-category-page .portal-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 14px;
    align-items: stretch;
    margin-bottom: 14px;
}

.compare-category-page .portal-hero-copy,
.compare-category-page .portal-hero-card {
    border: 1px solid #d9dde3;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(16, 24, 40, .035);
}

.compare-category-page .portal-hero-copy {
    padding: 22px 24px;
    background:
        radial-gradient(circle at top left, rgba(63, 143, 113, .12), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #f8fbf9 100%);
}

.compare-category-page .portal-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin: 0 0 8px;
    padding: 0 10px;
    border-radius: 999px;
    background: #ecfdf3;
    color: var(--green-dark);
    font-size: 11px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .08em;
}

.compare-category-page .portal-hero h1 {
    margin: 0;
    color: #111827;
    font-size: 2rem;
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: -.035em;
}

.compare-category-page .portal-hero p {
    margin: 10px 0 0;
    max-width: 900px;
    color: #667085;
    font-size: 15px;
    line-height: 1.7;
}

.compare-category-page .portal-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.compare-category-page .portal-primary-btn,
.compare-category-page .portal-secondary-btn {
    min-height: 42px;
    padding: 0 15px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 900;
}

.compare-category-page .portal-hero-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #f4fbf7 0%, #ffffff 100%);
}

.compare-category-page .portal-hero-card strong {
    color: var(--green-dark);
    font-size: 2.2rem;
    line-height: 1;
    font-weight: 900;
}

.compare-category-page .portal-hero-card span {
    margin-top: 6px;
    color: #111827;
    font-size: 1rem;
    font-weight: 900;
}

.compare-category-page .portal-hero-card p {
    margin: 8px 0 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.55;
}

/* Category chips */
.compare-category-page .portal-quick-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0 0 14px;
    padding: 8px 0;
    overflow-x: auto;
}

.compare-category-page .portal-quick-links a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #1f2937 !important;
    font-size: 13px;
    line-height: 1;
    font-weight: 900;
    white-space: nowrap;
}

.compare-category-page .portal-quick-links a:hover {
    background: #eef8f4;
    border-color: #cde7dd;
    color: var(--green-dark) !important;
}

/* Main list section */
.compare-category-page .portal-section {
    padding: 0;
    overflow: hidden;
    border: 1px solid #d9dde3;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(16, 24, 40, .035);
}

.compare-category-page .portal-section-head {
    margin: 0;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #e5efe9;
    background:
        linear-gradient(90deg, #f0faf5 0%, #ffffff 68%),
        #ffffff;
}

.compare-category-page .portal-section-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin-bottom: 6px;
    padding: 0 8px;
    border-radius: 999px;
    background: #dff5ea;
    color: var(--green-dark);
    font-size: 10px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.compare-category-page .portal-section-head h2 {
    position: relative;
    margin: 0;
    padding-left: 14px;
    color: #111827;
    font-size: 1.5rem;
    line-height: 1.18;
    font-weight: 900;
    letter-spacing: -.02em;
}

.compare-category-page .portal-section-head h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: .12em;
    width: 5px;
    height: 1.15em;
    border-radius: 999px;
    background: var(--green);
}

.compare-category-page .portal-section-head p {
    margin: 6px 0 0;
    max-width: 860px;
    color: #667085;
    font-size: 14px;
    line-height: 1.6;
}

.compare-category-page .portal-section-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #dce8e1;
    border-radius: 999px;
    background: #ffffff;
    color: #46685d;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

/* Grid: category ใช้ card ใหญ่กว่า portal นิดหนึ่ง */
.compare-category-page .portal-pair-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
}

/* Card reset ให้ไม่โดน theme link style */
.compare-category-page .portal-pair-card,
.compare-category-page .portal-pair-card:visited,
.compare-category-page .portal-pair-card:hover,
.compare-category-page .portal-pair-card:focus {
    min-width: 0;
    display: block;
    overflow: hidden;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    color: inherit !important;
    text-decoration: none !important;
    box-shadow: 0 0 1px rgba(0,0,0,.08);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.compare-category-page .portal-pair-card:hover {
    transform: translateY(-1px);
    border-color: #cde7dd;
    box-shadow: 0 8px 22px rgba(16, 24, 40, .06);
}

/* Top badges */
.compare-category-page .portal-pair-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.compare-category-page .portal-pair-tag,
.compare-category-page .portal-pair-price-diff {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    font-weight: 900;
    white-space: nowrap;
}

.compare-category-page .portal-pair-tag {
    background: #ecfdf3;
    color: var(--green-dark);
}

.compare-category-page .portal-pair-price-diff {
    background: #f3f4f6;
    color: #334155;
}

/* Car images */
.compare-category-page .portal-pair-images {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.compare-category-page .portal-car-shot {
    min-width: 0;
    height: 108px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: #fafcfc;
}

.compare-category-page .portal-car-shot img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    transform: scale(.9);
}

.compare-category-page .portal-vs {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    border: 1px solid #d9dde3;
    border-radius: 999px;
    background: rgba(255,255,255,.96);
    color: #334155;
    font-size: 10px;
    font-weight: 900;
    z-index: 2;
}

/* Card text */
.compare-category-page .portal-pair-card h3 {
    margin: 0 0 8px;
    min-height: 44px;
    color: #111827 !important;
    font-size: 1rem;
    line-height: 1.28;
    font-weight: 900;
    letter-spacing: -.01em;
    text-decoration: none !important;
}

.compare-category-page .portal-pair-card h3 a,
.compare-category-page .portal-pair-card h3:hover {
    color: #111827 !important;
    text-decoration: none !important;
}

.compare-category-page .portal-pair-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.compare-category-page .portal-pair-meta span {
    min-width: 0;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 8px;
    border: 1px solid #edf0f2;
    border-radius: 10px;
    background: #f8fafb;
    color: #111827;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 900;
    text-align: center;
}

/* Vote mini ให้ mood เหมือน portal */
.compare-category-page .portal-vote-mini {
    margin: 10px 0 8px;
    padding: 10px;
    border: 1px solid #dce8e1;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fbf9 0%, #f2f7f4 100%);
}

.compare-category-page .portal-vote-title {
    margin-bottom: 8px;
    color: var(--green-dark) !important;
    text-align: center;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 900;
    text-decoration: none !important;
}

.compare-category-page .portal-vote-mini-head {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.compare-category-page .portal-vote-mini-head strong {
    color: #0f172a;
    font-size: 1rem;
    line-height: 1;
    font-weight: 900;
}

.compare-category-page .portal-vote-mini-head strong:last-child {
    text-align: right;
}

.compare-category-page .portal-vote-mini-head span {
    color: #46685d;
    text-align: center;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 800;
}

.compare-category-page .portal-vote-bar {
    display: flex;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe5df;
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, .08);
}

.compare-category-page .portal-vote-bar i {
    display: block;
    height: 100%;
}

.compare-category-page .portal-vote-a {
    background: linear-gradient(90deg, #3f8f71 0%, #57a884 100%);
}

.compare-category-page .portal-vote-b {
    background: linear-gradient(90deg, #7d8795 0%, #596273 100%);
}

.compare-category-page .portal-vote-names {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 7px;
}

.compare-category-page .portal-vote-names span {
    min-width: 0;
    color: #334155;
    font-size: 11px;
    line-height: 1.25;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compare-category-page .portal-vote-names span:last-child {
    text-align: right;
}

.compare-category-page .portal-pair-reason {
    margin: 8px 0 0 !important;
    color: #667085 !important;
    font-size: 13px;
    line-height: 1.55;
    text-decoration: none !important;
}

/* Bottom internal links */
.compare-category-page .portal-editorial-block {
    padding: 20px 22px;
    margin-top: 18px;
    border: 1px solid #d9dde3;
    border-radius: 16px;
    background:
        radial-gradient(circle at top left, rgba(63, 143, 113, .10), transparent 34%),
        #ffffff;
    box-shadow: 0 6px 18px rgba(16, 24, 40, .035);
}

.compare-category-page .portal-editorial-block h2 {
    margin: 0 0 10px;
    color: #111827;
    font-size: 1.45rem;
    line-height: 1.25;
    font-weight: 900;
}

.compare-category-page .portal-editorial-block p {
    margin: 0;
    max-width: 980px;
    color: #667085;
    font-size: 14px;
    line-height: 1.75;
}

.compare-category-page .portal-landing-link-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.compare-category-page .portal-landing-link-group {
    min-width: 0;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fbfcfd;
}

.compare-category-page .portal-landing-link-group h3 {
    margin: 0 0 10px;
    color: var(--green-dark);
    font-size: 15px;
    line-height: 1.25;
    font-weight: 900;
}

.compare-category-page .portal-landing-link-group .portal-editorial-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 0;
}

.compare-category-page .portal-landing-link-group .portal-editorial-links a {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid #edf0f2;
    border-radius: 12px;
    background: #ffffff;
    color: #1f2937 !important;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 850;
    text-align: center;
}

.compare-category-page .portal-landing-link-group .portal-editorial-links a:hover {
    background: #eef8f4;
    border-color: #cde7dd;
    color: var(--green-dark) !important;
}

/* Responsive */
@media (max-width: 1439px) {
    .compare-category-page .portal-pair-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .compare-category-page .portal-hero {
        grid-template-columns: 1fr;
    }

    .compare-category-page .portal-pair-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compare-category-page .portal-landing-link-groups {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .compare-category-page .portal-main {
        padding-bottom: 22px;
    }

    .compare-category-page .portal-shell {
        max-width: 100%;
        margin-top: 10px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .compare-category-page .portal-breadcrumb {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .compare-category-page .portal-hero {
        gap: 10px;
        margin-bottom: 10px;
    }

    .compare-category-page .portal-hero-copy {
        padding: 15px 14px;
        border-radius: 14px;
    }

    .compare-category-page .portal-eyebrow {
        min-height: 22px;
        font-size: 10px;
        margin-bottom: 6px;
    }

    .compare-category-page .portal-hero h1 {
        font-size: 1.55rem;
        line-height: 1.16;
    }

    .compare-category-page .portal-hero p {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 13px;
        line-height: 1.55;
    }

    .compare-category-page .portal-hero-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 12px;
    }

    .compare-category-page .portal-primary-btn,
    .compare-category-page .portal-secondary-btn {
        min-height: 42px;
        padding: 0 10px;
        border-radius: 12px;
        font-size: 13px;
    }

    .compare-category-page .portal-hero-card {
        display: none;
    }

    .compare-category-page .portal-quick-links {
        position: sticky;
        top: 0;
        z-index: 30;
        margin: 0 -10px 10px;
        padding: 8px 10px;
        border-bottom: 1px solid #edf0f2;
        background: #ffffff;
    }

    .compare-category-page .portal-quick-links a {
        min-height: 36px;
        padding: 0 13px;
        font-size: 13px;
    }

    .compare-category-page .portal-section {
        border-radius: 12px;
    }

    .compare-category-page .portal-section-head {
        display: block;
        padding: 14px;
    }

    .compare-category-page .portal-section-head h2 {
        font-size: 1.22rem;
        line-height: 1.25;
    }

    .compare-category-page .portal-section-head p {
        font-size: 13px;
        line-height: 1.5;
    }

    .compare-category-page .portal-section-count {
        width: fit-content;
        min-height: 30px;
        margin-top: 10px;
        font-size: 11px;
    }

    .compare-category-page .portal-pair-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }

    .compare-category-page .portal-pair-card {
        padding: 11px;
        border-radius: 12px;
    }

    .compare-category-page .portal-car-shot {
        height: 96px;
    }

    .compare-category-page .portal-pair-card h3 {
        min-height: auto;
        font-size: 1rem;
    }

    .compare-category-page .portal-landing-link-group .portal-editorial-links {
        grid-template-columns: 1fr;
    }

    .compare-category-page .portal-editorial-block {
        padding: 14px;
        border-radius: 12px;
    }
}