/* --- Estilos Base y Mobile First --- */

.bcm-filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.bcm-filter-group {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
}

.bcm-filter-group label {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
}

.bcm-filter-group select,
.bcm-filter-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Estilos para el nuevo buscador en vivo */
.bcm-search-wrapper {
    position: relative; /* Para posicionar los resultados */
}

#bcm-live-search-results {
    position: absolute;
    top: 100%; /* Debajo del input */
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10; /* Asegura que esté por encima de otros elementos */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 4px 4px;
    display: none; /* Oculto por defecto, JS lo mostrará */
}

.bcm-search-result-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
}

.bcm-search-result-item:last-child {
    border-bottom: none;
}

.bcm-search-result-item:hover {
    background-color: #f0f0f0;
}

.bcm-search-result-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
}

.bcm-no-results {
    padding: 10px;
    text-align: center;
    color: #666;
}

.bcm-vehicle-list-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.bcm-vehicle-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.bcm-card-image-gallery .bcm-card-main-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #f0f0f0;
    overflow: hidden;
}

.bcm-card-image-gallery .bcm-card-main-image::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 33.33%;
    z-index: 1;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    -webkit-mask-image: linear-gradient(to top, black 25%, transparent 100%);
    mask-image: linear-gradient(to top, black 25%, transparent 100%);
}

.bcm-card-image-gallery .bcm-card-main-image::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 33.33%;
    z-index: 2;
    background: linear-gradient(to top, white 0%, rgba(255, 255, 255, 0) 75%);
}

.bcm-card-image-gallery .bcm-card-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bcm-card-thumbnails {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 5px;
    border-radius: 5px;
    background: #f9f9f9;
    overflow-x: auto;
}

.bcm-card-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.bcm-card-thumbnail:hover,
.bcm-card-thumbnail.active {
    border-color: #25d366;
}

.bcm-card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.bcm-card-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
}
.bcm-card-title a {
    text-decoration: none;
    color: #333;
}

/* Ajuste para 3 columnas en la cuadrícula de detalles */
.bcm-card-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Forzado a 3 columnas */
    gap: 8px 10px; /* Reduce el gap horizontal */
    margin: 0 0 15px 0;
    flex-grow: 1;
}

.bcm-detail-item {
    font-size: 14px;
    color: #555;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centra el contenido */
    text-align: center;
}

.bcm-detail-item strong {
    font-size: 12px;
    color: #888;
    margin-bottom: 2px;
}

/* Estilos para los iconos de las características */
.bcm-detail-item i {
    font-size: 24px; /* Tamaño del icono */
    color: #3a1942; /* Color del icono */
    margin-bottom: 5px; /* Espacio entre icono y texto */
}

.bcm-card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.bcm-button {
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    font-weight: bold;
    transition:
        background-color 0.2s,
        color 0.2s;
    font-size: 16px;
    display: inline-block;
    text-transform: uppercase; /* Botones en mayúsculas */
}

.bcm-card-actions .bcm-button {
    flex: 1;
}

/* Estilos para el botón "Lo quiero" */
.bcm-lo-quiero-btn {
    background-color: #3a1942; /* Fondo #3A1942 */
    color: white; /* Texto blanco */
    border-radius: 30px;
}

.bcm-lo-quiero-btn:hover {
    background-color: #ffd200; /* Fondo #FFD200 en hover */
    color: #121426; /* Texto #121426 en hover */
}

.bcm-whatsapp-btn {
    background-color: #25d366;
    color: white;
    border-radius: 30px;
}

/* Estilos para el botón "Más detalles" */
.bcm-details-btn {
    background-color: #25d366; /* Fondo #128C7E */
    color: white; /* Texto blanco */
    border-radius: 30px;
}

.bcm-details-btn:hover {
    background-color: #128c7e; /* Fondo #3A1942 en hover */
    color: white; /* Texto blanco en hover */
}

.bcm-view-all-container {
    text-align: center;
    margin-top: 40px;
    padding-bottom: 20px;
}

/* --- Estilos Página Single --- */

.bcm-single-vehicle-page {
    padding-top: 50px;
    padding-bottom: 50px;
}

.bcm-single-vehicle-page .entry-title {
    margin-bottom: 20px;
}
.bcm-single-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.bcm-single-main-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}
.bcm-single-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.bcm-single-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid #ccc;
    border-radius: 8px;
}
.bcm-single-thumbnail:hover,
.bcm-single-thumbnail.active {
    border-color: #25d366;
}
.bcm-single-details h3 {
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.bcm-details-list {
    list-style: none;
    padding: 0;
    font-size: 16px;
}
.bcm-details-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.bcm-details-list li:last-child {
    border-bottom: none;
}

.bcm-single-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
    border-top: 1px solid #f0f0f0;
    padding-top: 25px;
}

/* --- Media Queries --- */

@media (min-width: 600px) {
    .bcm-filter-group {
        flex: 1 1 45%;
    }
    .bcm-vehicle-list-results {
        grid-template-columns: repeat(2, 1fr);
    }
    .bcm-single-actions {
        flex-direction: row;
    }
    /* Se mantiene para asegurar que no haya conflictos, aunque la regla base ya lo define */
    .bcm-card-details-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .bcm-filter-group {
        flex: 1 1 15%;
    }
    .bcm-vehicle-list-results {
        grid-template-columns: repeat(3, 1fr);
    }
    .bcm-single-layout {
        flex-direction: row;
    }
    .bcm-single-gallery {
        flex: 0 0 60%;
    }
    .bcm-single-details {
        flex: 1;
    }
    /* Se mantiene para asegurar que no haya conflictos, aunque la regla base ya lo define */
    .bcm-card-details-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Estilos de tipografía y color para Single Page --- */

body.bcm-vehicle-template-active {
    background-color: #ffffff;
}

.bcm-single-vehicle-page {
    font-family: "Segoe UI", sans-serif;
    font-weight: 400;
    color: #121426;
}

.bcm-single-vehicle-page .entry-title,
.bcm-single-vehicle-page h3 {
    font-weight: 900;
    color: #121426;
}

.bcm-single-vehicle-page a {
    color: #3a1942;
    text-decoration: none;
}

.bcm-single-vehicle-page .bcm-button {
    color: white;
}
