/* ============================================
   BUSCADOR DE CONCESIONARIAS - ESTILOS COMPLETOS
   ============================================ */

/* Contenedor principal */
.cb-contenedor {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fb;
    border-radius: 16px;
}

/* ============================================
   HEADER
   ============================================ */
.cb-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
}

.cb-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
}

.cb-header p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* ============================================
   CAJA DE BÚSQUEDA PRINCIPAL
   ============================================ */
.cb-caja-busqueda {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.cb-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.cb-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.cb-boton {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.cb-boton:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.cb-boton:active {
    transform: translateY(0);
}

/* ============================================
   NÚMEROS RÁPIDOS (BOTONES)
   ============================================ */
.cb-numeros-rapidos {
    background: white;
    padding: 18px 22px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e8ecf0;
}

.cb-label-rapido {
    font-weight: 700;
    color: #4a5568;
    font-size: 14px;
    background: #f0f4f8;
    padding: 6px 14px;
    border-radius: 20px;
}

.cb-botones-numeros {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cb-numero-btn {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
}

.cb-numero-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.cb-cargando-numeros, 
.cb-sin-numeros {
    color: #a0aec0;
    font-size: 13px;
    padding: 5px 0;
}

/* ============================================
   ESTADOS DE CARGA Y MENSAJES
   ============================================ */
.cb-inicial, 
.cb-vacio, 
.cb-error {
    text-align: center;
    padding: 60px 30px;
    background: white;
    border-radius: 12px;
    color: #718096;
    border: 1px solid #e8ecf0;
}

.cb-inicial {
    color: #667eea;
    background: #f8faff;
}

.cb-vacio {
    color: #718096;
}

.cb-error {
    color: #e53e3e;
    background: #fff5f5;
    border-color: #fed7d7;
}

.cb-loading {
    text-align: center;
    padding: 60px 30px;
    background: white;
    border-radius: 12px;
}

.cb-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cb-sugerencia {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.6;
    margin-top: 20px;
    padding: 15px;
    background: #f0f4f8;
    border-radius: 10px;
}

/* ============================================
   TOTAL DE RESULTADOS
   ============================================ */
.cb-total {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-weight: 700;
    color: #4a5568;
    border-left: 4px solid #667eea;
    font-size: 15px;
}

/* ============================================
   TARJETAS DE CONCESIONARIAS
   ============================================ */
.cb-concesionaria {
    background: white;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cb-concesionaria:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.cb-concesionaria-titulo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.cb-concesionaria-titulo h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.cb-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
}

/* ============================================
   LISTA DE PRODUCTOS
   ============================================ */
.cb-productos-lista {
    padding: 20px;
}

.cb-producto {
    display: flex;
    gap: 18px;
    padding: 16px;
    border-bottom: 1px solid #edf2f7;
    transition: background 0.2s ease;
}

.cb-producto:last-child {
    border-bottom: none;
}

.cb-producto:hover {
    background: #fafbff;
}

/* Imagen del producto */
.cb-producto-img {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f4f8;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.cb-producto-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cb-sin-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Información del producto */
.cb-producto-info {
    flex: 1;
}

.cb-producto-titulo {
    font-weight: 700;
    font-size: 17px;
    color: #2d3748;
    margin-bottom: 6px;
}

.cb-producto-desc {
    font-size: 13px;
    color: #718096;
    line-height: 1.5;
    margin-bottom: 8px;
}

.cb-producto-precio {
    font-size: 17px;
    font-weight: 700;
    color: #48bb78;
    margin-bottom: 8px;
}

.cb-link {
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-block;
}

.cb-link:hover {
    color: #5a67d8;
    transform: translateX(3px);
}

/* ============================================
   BOTÓN VER TODOS
   ============================================ */
.cb-ver-todos {
    margin-top: 15px;
    padding: 12px 20px;
    background: #f0f4f8;
    color: #4a5568;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
}

.cb-ver-todos:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* ============================================
   MODAL
   ============================================ */
.cb-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.cb-modal-box {
    background: white;
    width: 90%;
    max-width: 850px;
    max-height: 85vh;
    border-radius: 20px;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cb-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 18px 24px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cb-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.cb-modal-cerrar {
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.cb-modal-cerrar:hover {
    transform: rotate(90deg) scale(1.1);
}

.cb-modal-body {
    padding: 24px;
    max-height: calc(85vh - 70px);
    overflow-y: auto;
}

/* Productos dentro del modal */
.cb-modal-productos {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cb-modal-producto {
    display: flex;
    gap: 18px;
    padding: 18px;
    border: 1px solid #edf2f7;
    border-radius: 14px;
    transition: all 0.2s ease;
    background: white;
}

.cb-modal-producto:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.cb-modal-producto-img {
    width: 110px;
    height: 110px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f4f8;
}

.cb-modal-producto-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cb-modal-producto-info {
    flex: 1;
}

.cb-modal-producto-info h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

.cb-modal-desc {
    font-size: 13px;
    color: #718096;
    line-height: 1.5;
    margin-bottom: 10px;
}

.cb-modal-precio {
    font-size: 20px;
    font-weight: 700;
    color: #48bb78;
    margin-bottom: 12px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 992px) {
    .cb-contenedor {
        padding: 15px;
    }
    
    .cb-concesionaria-titulo h3 {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .cb-caja-busqueda {
        flex-direction: column;
        gap: 12px;
    }
    
    .cb-boton {
        width: 100%;
        padding: 14px;
    }
    
    .cb-numeros-rapidos {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cb-botones-numeros {
        width: 100%;
        justify-content: center;
    }
    
    .cb-concesionaria-titulo {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .cb-producto {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .cb-producto-img {
        width: 120px;
        height: 120px;
    }
    
    .cb-modal-producto {
        flex-direction: column;
        text-align: center;
    }
    
    .cb-modal-producto-img {
        width: 100%;
        height: 160px;
    }
    
    .cb-header h2 {
        font-size: 24px;
    }
    
    .cb-header p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cb-contenedor {
        padding: 10px;
    }
    
    .cb-concesionaria-titulo h3 {
        font-size: 16px;
    }
    
    .cb-producto-titulo {
        font-size: 15px;
    }
    
    .cb-producto-precio {
        font-size: 15px;
    }
    
    .cb-badge {
        font-size: 11px;
    }
    
    .cb-numero-btn {
        padding: 6px 14px;
        font-size: 12px;
    }
    
    .cb-modal-header h3 {
        font-size: 16px;
    }
    
    .cb-modal-producto-info h4 {
        font-size: 16px;
    }
    
    .cb-modal-precio {
        font-size: 18px;
    }
}

/* ============================================
   SCROLLBAR PERSONALIZADA
   ============================================ */
.cb-modal-body::-webkit-scrollbar {
    width: 8px;
}

.cb-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.cb-modal-body::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.cb-modal-body::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

/* ============================================
   ANIMACIONES ADICIONALES
   ============================================ */
.cb-concesionaria {
    animation: fadeInUp 0.4s ease backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cb-concesionaria:nth-child(1) { animation-delay: 0.05s; }
.cb-concesionaria:nth-child(2) { animation-delay: 0.1s; }
.cb-concesionaria:nth-child(3) { animation-delay: 0.15s; }
.cb-concesionaria:nth-child(4) { animation-delay: 0.2s; }
.cb-concesionaria:nth-child(5) { animation-delay: 0.25s; }

/* ============================================
   UTILIDADES
   ============================================ */
.cb-text-center {
    text-align: center;
}

.cb-mt-20 {
    margin-top: 20px;
}

.cb-mb-20 {
    margin-bottom: 20px;
}

.cb-hidden {
    display: none;
}