/* ====================================
   ESTILOS PARA MEJORAS IMPLEMENTADAS
   Multinyectores Colombia
   ==================================== */

/* ===============================
   BÚSQUEDA DE PRODUCTOS
   =============================== */

.product-search-container {
    position: relative;
}

.product-search-input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.product-search-input:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: #475569;
}

/* Resultados de Búsqueda */
.search-results {
    position: absolute;
    max-width: 600px;
    margin: 8px auto;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 500px;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
}

.search-results-count {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.search-result-item {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f8fafc;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.search-result-content {
    flex: 1;
}

.search-result-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.search-result-description {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.search-result-meta {
    display: flex;
    gap: 16px;
    align-items: center;
}

.search-result-price {
    font-size: 16px;
    font-weight: 700;
    color: #dc2626;
}

.search-result-sku {
    font-size: 12px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
}

.no-results {
    padding: 60px 20px;
    text-align: center;
}

/* Resaltado de búsqueda */
mark {
    background: #fef08a;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* ===============================
   FILTROS AVANZADOS
   =============================== */

.filtros-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filtro-titulo {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin: 0;
    white-space: nowrap;
}

.filtro-select {
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}

.filtro-select:focus {
    border-color: #dc2626;
}

.filtro-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    transition: color 0.2s;
}

.checkbox-label:hover {
    color: #dc2626;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filtro-precio {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filtro-precio input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    outline: none;
}

.filtro-precio input:focus {
    border-color: #dc2626;
}

.filtro-precio span {
    color: #94a3b8;
    font-weight: 500;
    flex-shrink: 0;
}

.filtro-acciones {
    display: flex;
    gap: 12px;
    grid-column: 1 / -1;
    margin-top: 12px;
}

.btn-aplicar-filtros,
.btn-limpiar-filtros {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-aplicar-filtros {
    background: #dc2626;
    color: white;
}

.btn-aplicar-filtros:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-limpiar-filtros {
    background: #f1f5f9;
    color: #475569;
}

.btn-limpiar-filtros:hover {
    background: #e2e8f0;
}

.filter-results-count {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.no-products-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.btn-reset-filters {
    color: #dc2626;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}

.btn-reset-filters:hover {
    color: #b91c1c;
}

/* Highlight de producto */
.producto-card.highlight {
    animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
        transform: scale(1.02);
    }
}

/* ===============================
   BÚSQUEDA EN BLOG
   =============================== */

.blog-search {
    max-width: 600px;
    margin: 30px auto 0;
    position: relative;
}

.blog-search-input {
    width: 100%;
    padding: 14px 50px 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    background: white;
    transition: all 0.3s;
    outline: none;
}

.blog-search-input:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.blog-search-counter {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
}

.blog-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.blog-filter-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
}

.blog-filter-btn:hover {
    border-color: #dc2626;
    color: #dc2626;
    transform: translateY(-2px);
}

.blog-filter-btn.active {
    border-color: #dc2626;
    background: #dc2626;
    color: white;
}

/* Badge para categorías */
.badge {
    display: inline-block;
    padding: 4px 10px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 6px;
}

/* ===============================
   RESPONSIVE
   =============================== */

@media (max-width: 1200px) {
    .filtros-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .product-search-input,
    .blog-search-input {
        font-size: 14px;
        padding: 10px 40px 10px 14px;
    }

    .search-results {
        max-height: 400px;
    }

    .search-result-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-result-image {
        width: 100%;
        height: 150px;
    }

    .filtros-container {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }

    .filtro-acciones {
        flex-direction: column;
    }

    .blog-filters {
        gap: 8px;
    }

    .blog-filter-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .search-result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
