/* ============================================================
   CAMPA - Listado de vehículos
   Fichero: assets/css/campa.css
   (importar desde azeler.css o encolar por separado en add_js_css)
   ============================================================ */

/* --- Contenedor principal --- */
.azeler-campa-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 8px 40px;
    font-family: inherit;
}

/* --- Barra de búsqueda --- */
.campa-search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.campa-search-input {
    flex: 1 1 260px;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color .2s;
}
.campa-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.campa-search-btn,
.campa-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s, transform .1s;
    white-space: nowrap;
}
.campa-search-btn:active,
.campa-reset-btn:active { transform: scale(.97); }

.campa-search-btn {
    background: #2563eb;
    color: #fff;
}
.campa-search-btn:hover { background: #1d4ed8; }

.campa-reset-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}
.campa-reset-btn:hover { background: #e5e7eb; }

/* --- Contador de resultados --- */
.campa-count-label {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 14px;
}

/* --- Cuadrícula --- */
.campa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* --- Tarjeta de vehículo --- */
.campa-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .25s, transform .2s;
}
.campa-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    transform: translateY(-3px);
}

/* Imagen */
.campa-card-img-wrap {
    position: relative;
    aspect-ratio: 4/3;
    background: #f3f4f6;
    overflow: hidden;
}
.campa-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s;
}
.campa-card:hover .campa-card-img { transform: scale(1.04); }

.campa-card-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 48px;
}

/* Badge estado */
.campa-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* Cuerpo */
.campa-card-body {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.campa-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin: 0;
}
.campa-card-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}
.campa-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.campa-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 2px 7px;
}
.campa-card-price {
    font-size: 18px;
    font-weight: 800;
    color: #2563eb;
    margin-top: auto;
    padding-top: 10px;
}
.campa-card-price.sin-precio {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 400;
}

/* --- Loader --- */
.campa-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 0;
    color: #6b7280;
    font-size: 14px;
    gap: 14px;
}
.campa-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: campa-spin .8s linear infinite;
}
@keyframes campa-spin { to { transform: rotate(360deg); } }

/* --- Estado vacío --- */
.campa-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}
.campa-empty .dashicons {
    font-size: 52px;
    width: 52px;
    height: 52px;
    color: #d1d5db;
    display: block;
    margin: 0 auto 12px;
}
.campa-empty p { font-size: 15px; margin: 0; }

/* --- Paginación --- */
.campa-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.campa-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s, border-color .2s;
    color: #374151;
}
.campa-page-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.campa-page-btn:disabled {
    opacity: .4;
    cursor: default;
}
.campa-page-info {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .campa-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .campa-card-title { font-size: 13px; }
    .campa-card-price { font-size: 16px; }
}
@media (max-width: 380px) {
    .campa-grid { grid-template-columns: 1fr; }
}
