:root {
    --dark-gray: #1a1a1a;
    --accent-orange: #e1a700;
    --gray: red;
    --white: #fff;
    --black: #000;
    --light-gray: #f2f2f2;
    --mid-gray: #b3b3b3;
}

#texto-gris-oscuro {
    color: var(--dark-gray);
    font-weight: 500;
}

/* Botón de contacto mejorado */
#contacto {
    background-color: var(--dark-gray);
    color: var(--white);
    border: 2px solid var(--dark-gray);
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-decoration: none !important;
    display: inline-block;
    font-size: 1.2rem;
}

#contacto:hover {
    background-color: var(--accent-orange);
    color: var(--dark-gray) !important;
    transform: translateY(-2px);
}

/* Asegurar que el texto sea blanco */
#contacto,
#contacto:link,
#contacto:visited {
    color: var(--white) !important;
}


/* ================================================== ESTILOS DE FILTROS ======================================================================================*/

.filter-section {
    background: linear-gradient(135deg, #ffffff 0%, var(--light-gray) 100%);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(90, 52, 9, 0.05);
    border: 1px solid var(--accent-orange);
}

.filter-label {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 8px;
    display: block;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-label i {
    color: var(--accent-orange);
    width: 20px;
}

.search-input {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 18px;
    width: 100%;
    transition: all 0.3s ease;
    background-color: white;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.search-input:hover {
    border-color: var(--accent-orange);
    box-shadow: 0 5px 15px rgba(225, 167, 0, 0.1);
}

.search-input:focus {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 4px rgba(225, 167, 0, 0.1);
    outline: none;
    transform: translateY(-2px);
}

/* Estilo específico para selects */
select.search-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e1a700' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
    padding-right: 45px;
}

/* ===== SLIDERS MEJORADOS ===== */
.filter-slider-container {
    background-color: white;
    padding: 15px 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.filter-slider-container:hover {
    border-color: var(--accent-orange);
    box-shadow: 0 5px 15px rgba(225, 167, 0, 0.1);
}

.form-range::-webkit-slider-thumb {
    background-color: var(--accent-orange);
    border: 2px solid white;
    width: 22px;
    height: 22px;
    margin-top: -8px;
    box-shadow: 0 2px 10px rgba(225, 167, 0, 0.3);
    transition: all 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(225, 167, 0, 0.4);
}

.form-range::-moz-range-thumb {
    background-color: var(--accent-orange);
    border: 2px solid white;
    width: 22px;
    height: 22px;
    box-shadow: 0 2px 10px rgba(225, 167, 0, 0.3);
    transition: all 0.2s ease;
}

.form-range::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(225, 167, 0, 0.4);
}

.form-range::-webkit-slider-track {
    background: linear-gradient(90deg, var(--accent-orange) 0%, var(--accent-orange) var(--fill-percentage, 0%), var(--light-gray) var(--fill-percentage, 0%)) !important;
    border-radius: 10px;
    height: 6px;
}

.form-range::-moz-range-track {
    background: linear-gradient(90deg, var(--accent-orange) 0%, var(--accent-orange) var(--fill-percentage, 0%), var(--light-gray) var(--fill-percentage, 0%)) !important;
    border-radius: 10px;
    height: 6px;
}

/* Para Firefox usamos una aproximación ya que no soporta variables en tracks fácilmente */
.form-range::-moz-range-progress {
    background-color: var(--accent-orange);
    height: 6px;
    border-radius: 10px;
}

input[type=range] {
    accent-color: var(--accent-orange);
    border: transparent;
}

/* Valores de los sliders */
#precioValue,
#kmValue {
    background-color: var(--white);
    color: var(--dark-gray);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.95rem;
    min-width: 120px;
    text-align: center;
    border: 2px solid var(--accent-orange);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ===== BOTONES DE FILTRO MEJORADOS ===== */
#applyFilters {
    background: linear-gradient(135deg, var(--dark-gray) 0%, #2a2a2a 100%);
    color: var(--white);
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

#applyFilters::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#applyFilters:hover {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #f5b800 100%);
    color: var(--dark-gray);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(225, 167, 0, 0.3);
}

#applyFilters:hover::before {
    left: 100%;
}

#resetFilters {
    background-color: transparent;
    color: var(--dark-gray);
    border: 2px solid var(--mid-gray);
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

#resetFilters:hover {
    background-color: var(--white);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#resetFilters i {
    transition: transform 0.3s ease;
}

#resetFilters:hover i {
    transform: rotate(180deg);
}

/* Resultados */
#resultCount {
    font-size: 1.1rem;
    color: var(--dark-gray);
    background-color: white;
    padding: 8px 20px;
    border-radius: 30px;
    border: 2px solid var(--accent-orange);
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Mensaje sin resultados */
.no-results {
    padding: 60px 20px;
    text-align: center;
    background-color: var(--light-gray);
    border-radius: 15px;
    border: 2px dashed var(--mid-gray);
}

.no-results i {
    color: var(--accent-orange);
}

.no-results h3 {
    color: var(--dark-gray);
    font-weight: 600;
}

.no-results a {
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 600;
}

.no-results a:hover {
    text-decoration: underline;
}

/* ===== RESPONSIVE MEJORADO PARA FILTROS ===== */
@media (max-width: 992px) {
    .filter-section {
        padding: 25px;
    }

    .filter-label {
        font-size: 0.9rem;
    }

    #precioValue,
    #kmValue {
        min-width: 100px;
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .filter-section {
        padding: 20px;
        margin-left: 10px;
        margin-right: 10px;
    }

    .search-input {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    select.search-input {
        background-position: right 12px center;
        padding-right: 35px;
    }

    #applyFilters,
    #resetFilters {
        padding: 10px 20px;
        font-size: 0.95rem;
        width: 100%;
    }

    #resultCount {
        font-size: 0.95rem;
        padding: 6px 15px;
        margin-right: 0;
        margin-bottom: 10px;
        text-align: center;
        width: 100%;
    }

    .col-12.d-flex {
        flex-direction: column;
        align-items: stretch !important;
    }

    .col-12.d-flex .d-flex {
        flex-direction: column;
        width: 100%;
    }

    .filter-slider-container {
        padding: 12px 15px;
    }

    .d-flex.align-items-center {
        flex-wrap: wrap;
    }

    .d-flex.align-items-center span {
        margin-left: 0 !important;
        margin-top: 10px;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .filter-section {
        padding: 15px;
        margin-left: 5px;
        margin-right: 5px;
        border-radius: 15px;
    }

    .filter-label {
        font-size: 0.85rem;
        margin-bottom: 5px;
    }

    .search-input {
        padding: 8px 12px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    select.search-input {
        background-size: 12px;
    }

    #applyFilters,
    #resetFilters {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    #precioValue,
    #kmValue {
        min-width: 80px;
        padding: 5px 10px;
        font-size: 0.85rem;
    }

    .form-range {
        height: 5px;
    }

    .form-range::-webkit-slider-thumb {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 375px) {
    .filter-section {
        padding: 12px;
    }

    .filter-label {
        font-size: 0.8rem;
    }

    .search-input {
        padding: 7px 10px;
        font-size: 0.8rem;
    }

    #applyFilters,
    #resetFilters {
        padding: 7px 12px;
        font-size: 0.85rem;
    }
}

/* Colores para texto */
.text-dark-gray {
    color: var(--dark-gray) !important;
}


/* ================================================= ESTILOS DE COCHES ==================================================== */
/* Mejoras para las tarjetas de coches */
.coche-card .card-title {
    color: var(--accent-orange);
}

.coche-card .card-text {
    color: var(--dark-gray);
    line-height: 1.5;
    font-size: 1.1rem;
}

.coche-feature {
    font-size: 1.2rem;
}

.coche-card .btn-outline-primary {
    border-color: #6c757d;
    background-color: #6c757d;
    color: var(--white);
}

.coche-card .btn-outline-primary:hover {
    background-color: var(--white);
    color: var(--dark-gray);
}

/* Estilo para el badge de estado - Fuerza posición izquierda */
.coche-card .position-absolute.badge {
    left: 10px !important;
    right: auto !important;
    top: 10px !important;
    z-index: 10;
}

/* Asegurar que no haya otros estilos que lo muevan */
.coche-card .position-absolute {
    left: 10px !important;
}

/* Animación para las tarjetas */
.coche-card {
    transition: all 0.5s ease;
    border: 2px solid var(--accent-orange);
    border-radius: 25px;
    background-color: var(--light-gray);
}

.coche-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 2px 20px var(--accent-orange, 0.5) !important;
}

.form-container {
    background-color: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Mejoras responsive */
@media (max-width: 768px) {
    .coche-card .card-img-top {
        height: 180px;
    }

    .coche-feature {
        width: 100% !important;
        margin-bottom: 5px;
    }
}

@media (max-width: 576px) {
    .coche-card .card-img-top {
        height: 160px;
    }

    .coche-price {
        font-size: 1.3rem !important;
    }
}

/* ===== MEJORAS RESPONSIVE PARA CARDS ===== */

/* Móviles pequeños (menos de 576px) */
@media (max-width: 575.98px) {
    #coches-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .coche-card {
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100%;
    }

    .coche-card .card-body {
        padding: 1rem;
    }

    .coche-card .card-title {
        font-size: 1.2rem;
    }

    .precio-coche {
        font-size: 1.2rem;
    }

    .coche-feature {
        font-size: 0.9rem;
    }

    .coche-feature i {
        font-size: 1rem;
    }

    /* Ajustar altura de imágenes en móvil */
    .car-images-container,
    .car-image-slider img {
        height: 250px !important;
    }

    /* Botones de slider más pequeños */
    .car-slider-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    /* Badge de estado más pequeño */
    .coche-card .badge {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

/* Móviles medianos (576px - 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    #coches-container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .coche-card .card-body {
        padding: 1rem;
    }

    .coche-card .card-title {
        font-size: 1.3rem;
    }

    .car-images-container,
    .car-image-slider img {
        height: 200px !important;
    }
}

/* Tablets (768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .coche-card .card-title {
        font-size: 1.2rem;
    }

    .precio-coche {
        font-size: 1.2rem;
    }

    .coche-feature {
        font-size: 0.9rem;
    }

    .car-images-container,
    .car-image-slider img {
        height: 180px !important;
    }
}

/* Para pantallas muy pequeñas (menos de 375px) */
@media (max-width: 375px) {
    .coche-feature {
        font-size: 0.8rem;
    }

    .coche-feature i {
        font-size: 0.9rem;
    }

    .card-body {
        padding: 0.8rem;
    }

    .btn-custom {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* ===== ESTILOS PARA EL SLIDER DE IMÁGENES ===== */

.car-image-slider {
    position: relative;
    overflow: hidden;
    border-radius: 23px 23px 0 0;
    /* Para que coincida con el borde redondeado de la tarjeta */
}

.car-images-container {
    position: relative;
    height: 450px;
}

.car-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.5s ease-in-out;
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Botones del slider */
.car-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(26, 26, 26, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.car-slider-btn:hover {
    background-color: var(--accent-orange);
    transform: translateY(-50%) scale(1.1);
}

.car-slider-btn.prev-btn {
    left: 15px;
}

.car-slider-btn.next-btn {
    right: 15px;
}

/* Indicadores (puntos) */
.car-slider-indicators {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 20;
}

.car-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.car-indicator.active {
    background-color: var(--accent-orange);
    transform: scale(1.2);
}

.car-indicator:hover {
    background-color: white;
    transform: scale(1.2);
}

/* Contador de imágenes */
.car-image-counter {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(26, 26, 26, 0.7);
    color: var(--white);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 20;
    font-weight: 500;
}

/* Mejorar la transición entre imágenes */
.car-image {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.car-image.active {
    opacity: 1;
    position: relative;
}

/* Efecto hover en la imagen */
.car-image-slider:hover .car-image img {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* Responsive para el slider */
@media (max-width: 768px) {
    .car-slider-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .car-indicator {
        width: 8px;
        height: 8px;
    }

    .car-image-counter {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    .car-images-container,
    .car-image-slider img {
        height: 350px;
    }
}

@media (max-width: 576px) {

    .car-images-container,
    .car-image-slider img {
        height: 250px;
    }
}