.comparador-page {
    color: #21312a;
}

.comparador-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 15rem;
    overflow: hidden;
    padding: 2.5rem;
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(13, 28, 22, 0.9) 0%, rgba(13, 28, 22, 0.76) 46%, rgba(13, 28, 22, 0.3) 100%),
        url("/images/cocheverdeelectrico-seoimage.jpg") center / cover no-repeat;
}

.comparador-hero__content {
    max-width: 48rem;
    color: #ffffff;
}

.comparador-hero h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.05;
    font-weight: 800;
}

.comparador-hero p:not(.comparador-eyebrow) {
    max-width: 42rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.55;
}

.comparador-eyebrow {
    color: #b8f3d0;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.comparador-quicklinks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.comparador-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid #bfd8cc;
    border-radius: 999px;
    color: #0b5d38;
    background: #f2fbf6;
    font-weight: 800;
    line-height: 1.15;
    text-decoration: none;
}

.comparador-chip:hover,
.comparador-chip:focus-visible {
    border-color: #0f9f62;
    color: #083f29;
    background: #e4f7ec;
}

.comparador-length-filter,
.comparador-ranking,
.comparador-table-section {
    border: 1px solid #d6e4dc;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(24, 48, 38, 0.07);
}

.comparador-length-filter {
    padding: 1.15rem;
}

.comparador-length-filter__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comparador-length-filter__value,
.comparador-count {
    flex: 0 0 auto;
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    background: #e4f7ec;
    color: #0b5d38;
    font-size: 0.9rem;
    font-weight: 800;
    white-space: nowrap;
}

.comparador-length-filter__range {
    margin: 0.4rem 0 0.6rem;
    accent-color: #0f9f62;
}

.comparador-length-filter__labels {
    position: relative;
    min-height: 1.4rem;
    color: #52635b;
    font-size: 0.85rem;
    font-weight: 800;
}

.comparador-length-filter__labels span {
    position: absolute;
    top: 0;
    white-space: nowrap;
}

.comparador-length-filter__labels span:nth-child(1) {
    left: 0;
}

.comparador-length-filter__labels span:nth-child(2) {
    left: 33.333%;
    transform: translateX(-50%);
}

.comparador-length-filter__labels span:nth-child(3) {
    left: 66.666%;
    transform: translateX(-50%);
}

.comparador-length-filter__labels span:nth-child(4) {
    right: 0;
}

.comparador-rankings {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.comparador-ranking {
    height: 100%;
    padding: 1.15rem;
}

.comparador-ranking__header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.comparador-ranking__icon {
    width: 0.65rem;
    min-width: 0.65rem;
    height: 2.2rem;
    border-radius: 999px;
    background: #0f9f62;
}

.comparador-ranking h2 {
    margin: 0;
    color: #17251f;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.25;
}

.comparador-ranking__header p {
    margin: 0.2rem 0 0;
    color: #65746e;
    font-size: 0.9rem;
}

.comparador-ranking__list {
    display: grid;
    gap: 0.7rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: ranking;
}

.comparador-ranking__list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 0;
    border-top: 1px solid #edf2ef;
    counter-increment: ranking;
}

.comparador-ranking__list li::before {
    content: counter(ranking);
    display: inline-flex;
    grid-row: 1 / span 2;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    background: #f0f5f2;
    color: #52635b;
    font-size: 0.8rem;
    font-weight: 800;
}

.comparador-ranking__list a {
    grid-column: 2;
    min-width: 0;
    color: #183126;
    font-weight: 800;
    line-height: 1.25;
    text-decoration: none;
}

.comparador-ranking__list a:hover,
.comparador-ranking__list a:focus-visible {
    color: #0f9f62;
    text-decoration: underline;
}

.comparador-ranking__metric {
    grid-column: 3;
    color: #17251f;
    font-size: 0.95rem;
    white-space: nowrap;
}

.comparador-ranking__metric strong {
    font-size: 1.05rem;
}

.comparador-empty {
    padding: 0.8rem;
    border-radius: 8px;
    background: #f7faf8;
    color: #65746e;
}

.comparador-table-section {
    padding: 1.15rem;
}

.comparador-table-wrap {
    overflow: auto;
    border: 1px solid #dce7e1;
    border-radius: 8px;
}

.comparador-table {
    min-width: 62rem;
    margin-bottom: 0;
}

.comparador-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid #c8d8d0;
    background: #f4f8f6;
    color: #17251f;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.comparador-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 800;
    text-transform: inherit;
    cursor: pointer;
}

.comparador-sort-button::after {
    content: "↕";
    color: #5f746a;
    font-size: 0.85em;
}

.comparador-sort-button[aria-sort="ascending"]::after {
    content: "↑";
}

.comparador-sort-button[aria-sort="descending"]::after {
    content: "↓";
}

.comparador-sort-button:hover,
.comparador-sort-button:focus-visible {
    color: #0b6f46;
}

.comparador-table tbody th,
.comparador-table tbody td {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    vertical-align: middle;
}

.comparador-table th:first-child {
    min-width: 22rem;
}

.comparador-table a {
    color: #0b6f46;
    font-weight: 800;
}

@media (max-width: 991.98px) {
    .comparador-rankings {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .comparador-hero {
        min-height: 13rem;
        padding: 1.5rem;
    }

    .comparador-rankings {
        grid-template-columns: 1fr;
    }

    .comparador-length-filter__header {
        align-items: stretch;
        flex-direction: column;
    }

    .comparador-length-filter__value {
        align-self: flex-start;
    }

    .comparador-length-filter__labels {
        font-size: 0.72rem;
        gap: 0.35rem;
    }
}
