.table {
    width: 289px;

    .bg {
        border-radius: 15px;
        -webkit-border-radius: 15px;
        -moz-border-radius: 15px;
        -ms-border-radius: 15px;
        background: linear-gradient(135deg, #ECFEFF 0%, #DFF2FE 100%), #0BB4E8;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
    }

    .celda {
        height: 73px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-right: 1px solid #D9D9D9;
        font-size: 16px;
        color: #6B6B6B;

        b {
            color: var(--color-gray-900);
        }

        span {
            color: var(--primary);
            font-weight: 700;
        }

        .outline_compara {
            border: 1px solid var(--color-gray-900);
            color: var(--color-gray-900);
            font-weight: 500;
            line-height: 20px;
            font-size: 14px;
            background-color: transparent;
            padding: 10px 13px;
        }

        .card_celda {
            height: 100%;
            width: 100%;

            .info {
                padding: 30px 20px 30px 37px;

                h2 {
                    font-weight: 600;
                    line-height: 36px;
                    color: var(--color-gray-900);
                    margin-bottom: 15px;
                }

                p {
                    color: var(--gray-1);
                    font-weight: 400;
                    line-height: 20px;
                    margin-bottom: 10px;
                }
            }

            .info_resultados {
                padding: 0 47px;
                display: flex;
                flex-direction: column;
                height: 100%;

                .bnts-acciones {
                    display: flex;
                    justify-content: start;
                    align-items: center;
                    gap: 15px;
                    margin-top: auto;
                }

                img,
                .card-img-not {
                    margin-bottom: 16px;
                    object-fit: cover;
                    width: 207px;
                    height: 104px;
                    border-radius: 8px;
                    -webkit-border-radius: 8px;
                    -moz-border-radius: 8px;
                    -ms-border-radius: 8px;
                }

                .card-img-not {
                    display: flex;
                    justify-content: center;
                    align-items: center;
                }

                h5 {
                    color: var(--color-gray-900);
                    margin-bottom: 5px;
                    display: -webkit-box;
                    -webkit-line-clamp: 2;
                    -webkit-box-orient: vertical;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    // Altura fija para 2 líneas - consistencia entre cards
                    line-height: 1.3;
                    min-height: 2.6em; // 2 líneas * 1.3 line-height
                }

                .desp {
                    color: var(--gray-1);
                    font-style: normal;
                    font-weight: 400;
                    line-height: 18px;
                    margin-bottom: 11px;
                    display: -webkit-box;
                    -webkit-line-clamp: 1;
                    -webkit-box-orient: vertical;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    // Altura fija para consistencia entre cards
                    min-height: 18px;
                }

                .precio {
                    color: var(--color-gray-900);
                    font-weight: 700;
                    margin-bottom: 7px;
                }
            }
        }

        &.heade_celda {
            height: auto;
            min-height: 340px;
            width: 100%;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            padding-bottom: 20px;

            // La altura se sincroniza con JavaScript
            &.synced-height {
                min-height: unset;
            }
        }

        &:nth-child(even) {
            background-color: #F3F8FF;
        }

        &.border-radius-letf {
            border-radius: 15px 0px 0px 15px;
            -webkit-border-radius: 15px 0px 0px 15px;
            -moz-border-radius: 15px 0px 0px 15px;
            -ms-border-radius: 15px 0px 0px 15px;
        }

        &.not_boder {
            border-right: none;
        }

        &.first-spec {
            margin-top: 60px;
        }
    }

    &.resultados {
        display: flex;
        width: 911px;
        max-width: 911px;
        overflow-x: auto;

        .tr {
            width: 305px;
            min-width: 300px;

            .celda {
                padding-left: 15px;
                padding-right: 15px;
                box-sizing: border-box;

                &.first-spec {
                    margin-top: 60px;
                }
            }

            &:last-child {
                .celda {
                    border-right: none;
                    border-radius: 0px 15px 15px 0px;
                    -webkit-border-radius: 0px 15px 15px 0px;
                    -moz-border-radius: 0px 15px 15px 0px;
                    -ms-border-radius: 0px 15px 15px 0px;
                }
            }
        }
    }
}

// Estado vacío del comparador
.empty-state-wrapper {
    max-width: 800px;
    margin: 40px auto;
    text-align: center;

    .empty-state-card {
        border-radius: 15px;
        -webkit-border-radius: 15px;
        -moz-border-radius: 15px;
        -ms-border-radius: 15px;
        background: linear-gradient(135deg, #ECFEFF 0%, #DFF2FE 100%), #0BB4E8;
        padding: 60px 40px;
    }

    .empty-state-info {
        display: flex;
        flex-direction: column;
        align-items: center;

        img {
            width: 80px;
            height: 80px;
            margin-bottom: 24px;
        }

        h2 {
            font-size: 24px;
            font-weight: 600;
            line-height: 36px;
            color: var(--color-gray-900);
            margin-bottom: 16px;
        }

        p {
            font-size: 16px;
            line-height: 1.6;
            color: var(--gray-1);
            margin-bottom: 32px;
            max-width: 600px;
        }

        .btn.primary {
            padding: 12px 32px;
            font-size: 16px;
        }
    }
}

.row_table {
    display: flex;
    margin-top: 30px;
    margin-bottom: 30px;
}

// Estilos para checkboxes y botón de cotizar
.celda-checkbox {
    .checkbox-container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .checkbox-label {
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        user-select: none;

        input[type="checkbox"] {
            width: 20px;
            height: 20px;
            cursor: pointer;
            accent-color: var(--primary);
        }

        .checkbox-text {
            font-size: 14px;
            color: var(--color-gray-900);
            font-weight: 500;
        }
    }
}

// Contenedor del botón inferior
.cotizar-button-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    margin-bottom: 87px;

    .btn-cotizar-seleccionados {
        min-width: 300px;
        padding: 14px 40px;
        font-size: 16px;
        font-weight: 600;
        text-align: center;
        transition: all 0.3s ease;

        &:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            background-color: #D9D9D9;
            color: #6B6B6B;
            border-color: #D9D9D9;
        }

        &:not(:disabled) {
            cursor: pointer;

            &:hover {
                transform: translateY(-2px);
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            }
        }
    }
}

// Estilos para especificaciones completas
.specs-row-hidden {
    display: none !important;
}

.celda-label-specs {
    min-height: 150px;
    align-items: center !important; // Centrado vertical
    padding: 20px !important;
}

.celda-specs-completas {
    min-height: 150px;
    align-items: flex-start !important; // Arriba para el contenido
    padding: 20px !important;

    .specs-full-content {
        width: 100%;
        text-align: left;

        .specs-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--primary);
            margin-bottom: 12px;
            text-transform: uppercase;
        }

        .specs-html {
            font-size: 13px;
            line-height: 1.6;
            color: var(--color-gray-900);

            .specs-list {
                margin: 0;
                padding-left: 20px;
                list-style: disc;

                .specs-item {
                    margin-bottom: 8px;
                    color: var(--gray-1);
                }
            }

            .specs-block {
                margin-bottom: 10px;
            }

            ul:not(.specs-list) {
                margin: 0;
                padding-left: 20px;
                list-style: disc;

                li {
                    margin-bottom: 8px;
                    color: var(--gray-1);
                }
            }
        }
    }
}


@media (min-width: 768px) and (max-width: 1200px) and (orientation: portrait) {
    .row_table {
        width: 700px;
        max-width: 700px;
        margin: 53px auto;
    }

    .table {


        &.resultados {
            width: 400px;
            max-width: 400px;

            .tr {
                width: 260px;
                min-width: 260px
            }
        }
    }
}


@media (min-width: 768px) and (max-width: 1200px) and (orientation: landscape) {
    .row_table {
        width: 950px;
        max-width: 950px;
        margin: 53px auto;
    }

    .table {
        &.resultados {
            width: 650px;
            max-width: 650px;

            .tr {
                width: 260px;
                min-width: 260px
            }
        }
    }
}

@media (min-width: 768px) and (max-width: 992px) and (orientation: landscape) {
    .row_table {
        width: 830px;
        max-width: 830px;
        margin: 20px auto;
    }

    .table {
        &.resultados {
            width: 530px;
            max-width: 530px;

            .tr {
                width: 260px;
                min-width: 260px
            }
        }

         .celda {
            .card_celda {
                .info_resultados {
                    h5 {
                        font-size: 18px;
                    }
                }

                .info {
                    h2 {
                        line-height: 27px;
                        font-size: 20px;
                    }
                }
            }
        }
    }
}

@media (min-width: 768px) and (max-width: 850px) and (orientation: landscape) {

       .row_table {
        width: 730px;
        max-width: 730px;
        margin: 20px auto;
    }

    .table {
        &.resultados {
            width: 430px;
            max-width: 430px;

            .tr {
                width: 260px;
                min-width: 260px
            }
        }

         .celda {
            .card_celda {
                .info_resultados {
                    h5 {
                        font-size: 18px;
                    }
                }

                .info {
                    h2 {
                        line-height: 27px;
                        font-size: 20px;
                    }
                }
            }
        }
    }
}
@media (max-width: 767px) {
    .row_table {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        margin-top: 20px;
    }

    .table {
        width: 230px;

        &.resultados {
            width: 100%;
            max-width: 1000px;
            overflow-x: hidden;

            .tr {
                width: 260px;
                min-width: 260px
            }
        }

        .celda {
            .card_celda {
                .info_resultados {
                    padding: 0 20px;

                    img,
                    .card-img-not {
                        width: 100%;
                        max-width: 220px;
                        height: auto;
                        aspect-ratio: 2 / 1;
                    }

                    h5 {
                        font-size: 18px;
                    }
                }

                .info {
                    h2 {
                        line-height: 27px;
                        font-size: 20px;
                    }
                }
            }
        }
    }
}

// Estado de loading
.comparison-loading-state {
    max-width: 800px;
    margin: 80px auto;
    text-align: center;
    padding: 60px 40px;

    .loading-spinner-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 24px;

        p {
            font-size: 16px;
            color: var(--gray-1);
            font-weight: 500;
        }
    }

    .loading-spinner {
        width: 60px;
        height: 60px;
        border: 4px solid #E5E7EB;
        border-top-color: var(--primary);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }
}

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

// Estilos para columnas vacías (agregar más vehículos)
.tr-empty {
    opacity: 0.6;

    .empty-vehicle-placeholder {
        background-color: #F3F8FF;
        border: 2px dashed #D1D5DB;
    }

    .celda-empty {
        color: #9CA3AF;
    }
}

// Responsive loading
@media (max-width: 767px) {
    .comparison-loading-state {
        margin: 40px auto;
        padding: 40px 20px;

        .loading-spinner {
            width: 50px;
            height: 50px;
            border-width: 3px;
        }

        .loading-spinner-container p {
            font-size: 14px;
        }
    }
}

// Modal para agregar vehículos
.modal-add-vehicle {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;

    .modal-add-vehicle-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
    }

    .modal-add-vehicle-content {
        position: relative;
        background: white;
        border-radius: 16px;
        max-width: 1000px;
        width: 90%;
        max-height: 85vh;
        overflow-y: auto;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        z-index: 10000;
    }

    .modal-add-vehicle-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 24px 32px;
        border-bottom: 1px solid #E5E7EB;

        h3 {
            margin: 0;
            font-size: 24px;
            font-weight: 600;
            color: var(--color-gray-900);
        }

        .modal-close-btn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            transition: background-color 0.2s;

            &:hover {
                background-color: #F3F4F6;
            }

            img {
                width: 24px;
                height: 24px;
            }
        }
    }

    .modal-add-vehicle-body {
        padding: 32px;

        .modal-subtitle {
            font-size: 16px;
            color: var(--gray-1);
            margin-bottom: 24px;
            text-align: center;
        }

        .modal-vehicles-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
            gap: 20px;
            margin-bottom: 32px;
        }

        .modal-vehicle-card {
            background: white;
            border: 1px solid #E5E7EB;
            border-radius: 12px;
            overflow: hidden;
            transition: all 0.3s ease;
            cursor: pointer;

            &:hover {
                transform: translateY(-4px);
                box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
                border-color: var(--primary);
            }

            // Vehículo ya seleccionado - ocultar
            &.vehicle-already-selected {
                display: none;
            }

            // Vehículo que se está reemplazando - mostrar con indicador
            &.vehicle-being-replaced {
                opacity: 0.6;
                position: relative;

                &::before {
                    content: 'Actual';
                    position: absolute;
                    top: 10px;
                    left: 10px;
                    background: rgba(255, 193, 7, 0.9);
                    color: #000;
                    padding: 4px 12px;
                    border-radius: 6px;
                    font-size: 12px;
                    font-weight: 600;
                    z-index: 1;
                }

                .btn-add-to-compare {
                    pointer-events: none;
                    opacity: 0.5;
                }
            }

            .modal-vehicle-image {
                width: 100%;
                height: 140px;
                overflow: hidden;
                background-color: #F9FAFB;
                display: flex;
                align-items: center;
                justify-content: center;

                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }

                .modal-vehicle-placeholder {
                    width: 100%;
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    background-color: #F3F4F6;
                }
            }

            .modal-vehicle-info {
                padding: 16px;

                .modal-vehicle-brand {
                    font-size: 12px;
                    font-weight: 600;
                    color: var(--primary);
                    margin: 0 0 8px 0;
                    text-transform: uppercase;
                    letter-spacing: 0.5px;
                }

                .modal-vehicle-name {
                    font-size: 16px;
                    font-weight: 600;
                    color: var(--color-gray-900);
                    margin: 0 0 8px 0;
                    line-height: 1.3;
                    min-height: 42px;
                    display: -webkit-box;
                    -webkit-line-clamp: 2;
                    -webkit-box-orient: vertical;
                    overflow: hidden;
                }

                .modal-vehicle-price {
                    font-size: 18px;
                    font-weight: 700;
                    color: var(--color-gray-900);
                    margin: 0 0 16px 0;
                }

                .btn-add-to-compare {
                    width: 100%;
                    padding: 10px;
                    font-size: 14px;
                    font-weight: 600;
                    border-radius: 8px;
                    transition: all 0.2s;

                    &:hover {
                        transform: translateY(-2px);
                        box-shadow: 0 4px 12px rgba(11, 132, 232, 0.3);
                    }
                }
            }
        }

        .modal-footer-action {
            text-align: center;
            padding-top: 24px;
            border-top: 1px solid #E5E7EB;

            .btn.outline {
                padding: 12px 32px;
                font-size: 16px;
            }
        }
    }
}

// Responsive para el modal
@media (max-width: 767px) {
    .modal-add-vehicle {
        .modal-add-vehicle-content {
            width: 95%;
            max-height: 90vh;
        }

        .modal-add-vehicle-header {
            padding: 20px;

            h3 {
                font-size: 20px;
            }
        }

        .modal-add-vehicle-body {
            padding: 20px;

            .modal-vehicles-grid {
                grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
                gap: 16px;
            }

            .modal-vehicle-card {
                .modal-vehicle-image {
                    height: 100px;
                }

                .modal-vehicle-info {
                    padding: 12px;

                    .modal-vehicle-name {
                        font-size: 14px;
                        min-height: 38px;
                    }

                    .modal-vehicle-price {
                        font-size: 16px;
                        margin-bottom: 12px;
                    }

                    .btn-add-to-compare {
                        padding: 8px;
                        font-size: 13px;
                    }
                }
            }
        }
    }
}

// Spinner para estado de loading en botones del modal
.modal-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: modal-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

// Selector de versiones en comparador - específico para .celda.heade_celda
.celda.heade_celda {
    .info_resultados {
        .version-selector-container {
            width: 100%;
            margin: 8px 0;
        }

        .version-selector {
            width: 100%;
            padding: 8px 12px;
            font-size: 13px;
            font-weight: 500;
            color: var(--color-gray-900);
            background-color: #fff;
            border: 1px solid var(--primary);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230BB4E8' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 12px center;
            padding-right: 32px;

            &:hover {
                border-color: var(--secondary);
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            }

            &:focus {
                outline: none;
                border-color: var(--secondary);
                box-shadow: 0 0 0 3px rgba(11, 180, 232, 0.2);
            }
        }

        .version-unica {
            font-size: 13px;
            font-weight: 500;
            color: var(--primary);
            margin: 8px 0;
            padding: 8px 12px;
            background-color: rgba(11, 180, 232, 0.1);
            border-radius: 8px;
            text-align: center;
        }
    }
}

// Responsive para selector de versiones en comparador
@media (max-width: 768px) {
    .celda.heade_celda {
        .info_resultados {
            .version-selector-container {
                margin: 6px 0;
            }

            .version-selector {
                font-size: 12px;
                padding: 6px 10px;
                padding-right: 28px;
            }

            .version-unica {
                font-size: 12px;
                padding: 6px 10px;
            }
        }
    }
}