/* ================================================================
   NVZ BÚSQUEDA DE REPUESTOS - Estilos Frontend
   ================================================================ */

/* ----------------------------------------------------------------
   VARIABLES
   ---------------------------------------------------------------- */
:root {
    --nvz-primary: #2196F3;
    --nvz-primary-dark: #1976D2;
    --nvz-accent: #FF9800;
    --nvz-bg-light: #f8f9fa;
    --nvz-bg-white: #ffffff;
    --nvz-text: #333333;
    --nvz-text-muted: #777777;
    --nvz-border: #dee2e6;
    --nvz-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --nvz-radius: 8px;
}

/* ----------------------------------------------------------------
   CONTENEDOR DE FILTROS (Página completa)
   ---------------------------------------------------------------- */
.nvz-search-filters-container {
    background: var(--nvz-bg-white);
    border: 1px solid var(--nvz-border);
    border-radius: var(--nvz-radius);
    padding: 25px 20px;
    margin-bottom: 25px;
    box-shadow: var(--nvz-shadow);
}

.nvz-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.nvz-filter-group {
    flex: 1 1 180px;
    min-width: 160px;
}

.nvz-filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--nvz-text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.nvz-filter-btn-group {
    flex: 0 0 auto;
}

/* ----------------------------------------------------------------
   SELECTS
   ---------------------------------------------------------------- */
.nvz-select {
    width: 100%;
    padding: 10px 35px 10px 12px;
    border: 2px solid var(--nvz-border);
    border-radius: 6px;
    font-size: 14px;
    background-color: var(--nvz-bg-white);
    color: var(--nvz-text);
    cursor: pointer;
    appearance: none;
    -webkit-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='%23777'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.nvz-select:focus {
    outline: none;
    border-color: var(--nvz-primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}

.nvz-select:disabled {
    background-color: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

.nvz-select.nvz-loading-select {
    background-image: none;
    position: relative;
}

/* ----------------------------------------------------------------
   BOTÓN BUSCAR
   ---------------------------------------------------------------- */
.nvz-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
    transition: background-color 0.2s, transform 0.1s;
}

.nvz-search-btn:hover {
    transform: translateY(-1px);
}

.nvz-search-btn:active {
    transform: translateY(0);
}

.nvz-search-btn .fa {
    font-size: 16px;
}

/* ----------------------------------------------------------------
   INDICADOR DE CARGA
   ---------------------------------------------------------------- */
.nvz-loading {
    text-align: center;
    padding: 40px 20px;
}

.nvz-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--nvz-border);
    border-top-color: var(--nvz-primary);
    border-radius: 50%;
    animation: nvz-spin 0.8s linear infinite;
}

@keyframes nvz-spin {
    to { transform: rotate(360deg); }
}

.nvz-loading p {
    margin-top: 12px;
    color: var(--nvz-text-muted);
    font-size: 14px;
}

/* ----------------------------------------------------------------
   RESUMEN DE BÚSQUEDA
   ---------------------------------------------------------------- */
.nvz-search-summary {
    background: var(--nvz-bg-light);
    border-left: 4px solid var(--nvz-primary);
    padding: 14px 18px;
    margin-bottom: 20px;
    border-radius: 0 var(--nvz-radius) var(--nvz-radius) 0;
}

.nvz-results-count {
    margin: 0;
    font-size: 15px;
    color: var(--nvz-text);
}

.nvz-vehicle-label {
    font-weight: 700;
    color: var(--nvz-primary-dark);
}

.nvz-no-results {
    margin: 0;
    font-size: 15px;
    color: var(--nvz-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nvz-no-results .fa {
    color: var(--nvz-accent);
    font-size: 18px;
}

/* ----------------------------------------------------------------
   GRID DE PRODUCTOS
   ---------------------------------------------------------------- */
.nvz-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.nvz-product-card {
    background: var(--nvz-bg-white);
    border: 1px solid var(--nvz-border);
    border-radius: var(--nvz-radius);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.nvz-product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.nvz-product-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 1;
}

.nvz-product-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nvz-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.nvz-product-card:hover .nvz-product-image img {
    transform: scale(1.05);
}

.nvz-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ccc;
}

.nvz-no-image .fa {
    font-size: 64px;
}

.nvz-product-info {
    padding: 14px;
}

.nvz-product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--nvz-text);
    margin: 0 0 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nvz-product-ref {
    display: block;
    font-size: 12px;
    color: var(--nvz-text-muted);
    margin-bottom: 8px;
}

.nvz-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #000;
}

.nvz-product-actions {
    padding: 0 14px 14px;
}

.nvz-view-btn {
    width: 100%;
    text-align: center;
    font-size: 13px;
}

/* ----------------------------------------------------------------
   PAGINACIÓN
   ---------------------------------------------------------------- */
.nvz-pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.nvz-pagination .pagination {
    display: flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nvz-pagination .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 4px 10px;
    border: 1px solid var(--nvz-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--nvz-text);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.nvz-pagination .page-item .page-link:hover {
    background-color: var(--nvz-primary);
    color: #fff;
    border-color: var(--nvz-primary);
}

.nvz-pagination .page-item.active .page-link {
    background-color: var(--nvz-primary);
    color: #fff;
    border-color: var(--nvz-primary);
    pointer-events: none;
}

/* ----------------------------------------------------------------
   CABECERA DE RESULTADOS (Label + Botón Modificar)
   ---------------------------------------------------------------- */
.nvz-results-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: var(--nvz-bg-white);
    border: 1px solid var(--nvz-border);
    border-radius: var(--nvz-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--nvz-shadow);
}

.nvz-article-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
}

.nvz-results-search-form {
    flex: 1 1 320px;
    max-width: 560px;
}

.nvz-results-search-group {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.nvz-results-search-input {
    flex: 1 1 auto;
    min-width: 180px;
    padding: 10px 14px;
    border: 2px solid var(--nvz-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--nvz-text);
    background: var(--nvz-bg-white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.nvz-results-search-input:focus {
    outline: none;
    border-color: var(--nvz-primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}

.nvz-results-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.nvz-label-text {
    font-weight: 400;
    color: var(--nvz-text-muted);
}

.nvz-label-vehicle {
    font-weight: 700;
    color: var(--nvz-text);
}

.nvz-modify-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background: var(--nvz-bg-light);
    border: 1px solid var(--nvz-border);
    border-radius: 6px;
    color: var(--nvz-text);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.nvz-modify-btn:hover {
    background-color: var(--nvz-primary);
    border-color: var(--nvz-primary);
    color: #fff;
}

.nvz-modify-btn .fa {
    font-size: 14px;
}

/* Filtros ocultos */
.nvz-filters-hidden {
    display: none;
}

.nvz-filters-hidden.nvz-filters-visible {
    display: block;
}

/* ----------------------------------------------------------------
   MENSAJE DE BIENVENIDA
   ---------------------------------------------------------------- */
.nvz-welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--nvz-text-muted);
}

.nvz-welcome-icon .fa {
    font-size: 72px;
    color: var(--nvz-border);
    margin-bottom: 16px;
    display: block;
}

.nvz-welcome-message h3 {
    font-size: 22px;
    color: var(--nvz-text);
    margin-bottom: 10px;
}

.nvz-welcome-message p {
    font-size: 15px;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ----------------------------------------------------------------
   WIDGET (hook displayHome / displayTopColumn)
   ---------------------------------------------------------------- */
.nvz-search-widget {
    background: #0f0f10;
    border: 1px solid #2a2a2d;
    border-radius: var(--nvz-radius);
    padding: 28px 24px;
    margin-bottom: 30px;
    color: #f5f5f5;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.nvz-widget-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.nvz-widget-icon {
    font-size: 32px;
    color: #ffffff;
    opacity: 1;
}

.nvz-widget-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.nvz-widget-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.nvz-widget-field {
    flex: 1 1 170px;
    min-width: 150px;
}

.nvz-widget-field .nvz-select {
    background-color: #f7f7f8;
    border: 1px solid #3a3a3d;
    padding: 12px 35px 12px 14px;
    font-size: 14px;
    color: #1f1f1f;
}

.nvz-widget-field .nvz-select:focus {
    border-color: #ffb74d;
    box-shadow: 0 0 0 3px rgba(255, 183, 77, 0.28);
}

.nvz-widget-submit {
    flex: 0 0 auto;
}

.nvz-widget-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    background: #ff9800;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.nvz-widget-btn:hover {
    background-color: #fb8c00;
    transform: translateY(-1px);
}

.nvz-widget-btn .fa {
    font-size: 18px;
}

/* ----------------------------------------------------------------
   RESPONSIVO
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
    .nvz-results-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .nvz-article-label {
        flex-direction: column;
        gap: 4px;
    }

    .nvz-results-search-form {
        width: 100%;
        max-width: none;
    }

    .nvz-results-search-group {
        flex-direction: column;
    }

    .nvz-results-search-btn {
        width: 100%;
        justify-content: center;
    }

    .nvz-filters-row {
        flex-direction: column;
    }

    .nvz-filter-group {
        flex: 1 1 100%;
    }

    .nvz-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .nvz-product-name {
        font-size: 13px;
    }

    .nvz-product-price {
        font-size: 16px;
    }

    .nvz-widget-filters {
        flex-direction: column;
    }

    .nvz-widget-field {
        flex: 1 1 100%;
    }

    .nvz-widget-btn {
        width: 100%;
        justify-content: center;
    }

    .nvz-search-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nvz-search-filters-container {
        padding: 15px 12px;
    }

    .nvz-results-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .nvz-product-info {
        padding: 10px;
    }

    .nvz-product-price {
        font-size: 14px;
    }

    .nvz-search-widget {
        padding: 18px 14px;
    }

    .nvz-widget-header h3 {
        font-size: 17px;
    }
}
