/**
 * Estilos para el modal de búsqueda de productos
 * Archivo: search.css
 */

/* Estilos modernos para el modal de búsqueda rápida */
.modal-search-modern {
    max-width: 600px;
}

.modal-search-content {
    border: none;
    border-radius: 24px;
       background: transparent;
    position: relative;
    overflow: visible;
}

.btn-close-modern {
position: relative;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: end;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 10;
    left: 100%;
    bottom: 80px;
}

.btn-close-modern:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #374151;
    transform: scale(1.1);
}

.modal-body-modern {
    /* padding: 60px 40px 40px; */
}

.search-form-modern {
    width: 100%;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.search-input-container:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 8px 30px rgba(0, 0, 0, 0.12);
    background: #ffffff;
}

.search-icon {
    position: absolute;
    left: 20px;
    color: #9ca3af;
    transition: color 0.3s ease;
    z-index: 2;
}

.search-input-container:focus-within .search-icon {
    color: #3b82f6;
}

.search-input-modern {
    flex: 1;
    border: none;
    background: transparent;
    padding: 16px 20px 16px 56px;
    font-size: 16px;
    font-weight: 400;
    color: #1f2937;
    outline: none;
    border-radius: 12px;
}

.search-input-modern::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.search-btn-modern {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    min-width: 48px;
    height: 48px;
}

.search-btn-modern:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.search-btn-modern:active {
    transform: translateX(1px) scale(0.98);
}

/* Animación de entrada del modal */
#quickSearchModal.show .modal-search-content {
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Estilos para el modal de búsqueda completa (mantener compatibilidad) */
#searchModal .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#searchModal .modal-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
    padding: 1.5rem;
}

#searchModal .modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

#searchModal .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

#searchModal .btn-close:hover {
    opacity: 1;
}

#searchModal .modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

/* Estilos para el formulario de búsqueda */
#searchForm .input-group {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

#searchInput {
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background-color: #f8f9fa;
}

#searchInput:focus {
    background-color: white;
    box-shadow: none;
    border-color: transparent;
}

#searchForm .btn {
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #007bff, #0056b3);
    transition: all 0.3s ease;
}

#searchForm .btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
}

/* Estilos para los resultados de búsqueda */
#searchResults {
    margin-top: 1rem;
}

.product-search-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.product-search-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-search-card .card-img-top {
    transition: transform 0.3s ease;
}

.product-search-card:hover .card-img-top {
    transform: scale(1.05);
}

.product-search-card .card-body {
    padding: 1.25rem;
}

.product-search-card .card-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.product-search-card .card-text {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #6c757d;
}

.product-search-card .btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    transition: all 0.3s ease;
}

.product-search-card .btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
}

/* Estilos para estados de carga y vacío */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

.text-muted p {
    font-size: 1rem;
    margin-bottom: 0;
}

.search-results h2 {
  font-size: 1.5rem;
  color: #005eb8;
  margin-bottom: 20px;
}

.search-item .title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #333;
}

.search-item .description {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.4;
}

.search-pagination .page-link {
  font-size: 0.875rem;
  padding: 8px 12px;
}

.no-results {
  font-size: 1rem;
  color: #999;
  text-align: center;
  padding: 40px 0;
}

/* Responsive */
/* Media Query específica para zoom 150% en Windows */
@media only screen and (min-width: 853px) and (max-width: 854px) {
  .search-container {
    padding: 15px;
    max-width: 800px;
  }
  
  .search-form {
    padding: 15px;
  }
  
  .search-input {
    font-size: 14px;
    padding: 8px 12px;
  }
  
  .search-button {
    padding: 8px 16px;
    font-size: 14px;
  }
  
  .search-results {
    padding: 15px;
  }
  
  .search-result-item {
    padding: 15px;
    margin-bottom: 15px;
  }
  
  .search-result-title {
    font-size: 1.1rem;
  }
  
  .search-result-excerpt {
    font-size: 0.9rem;
  }
  
  .search-filters {
    padding: 15px;
  }
  
  .filter-group {
    margin-bottom: 15px;
  }
  
  .filter-label {
    font-size: 0.9rem;
  }
  
  .filter-select {
    font-size: 0.85rem;
    padding: 6px 10px;
  }
}

@media (max-width: 768px) {
    #searchModal .modal-dialog {
        margin: 1rem;
    }
    
    #searchModal .modal-body {
        padding: 1.5rem;
        max-height: 60vh;
    }
    
    .product-search-card .card-body {
        padding: 1rem;
    }
    
    #searchForm .input-group {
        flex-direction: column;
    }
    
    #searchForm .btn {
        border-radius: 0 0 10px 10px;
        margin-top: -1px;
    }
    
    #searchInput {
        border-radius: 10px 10px 0 0;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-search-card {
    animation: fadeInUp 0.5s ease forwards;
}

/* Scrollbar personalizado para el modal */
#searchModal .modal-body::-webkit-scrollbar {
    width: 6px;
}

#searchModal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#searchModal .modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#searchModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Estilos para el botón de búsqueda en el header */
.btn-blog {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-blog:hover {
    background-color: rgba(0, 123, 255, 0.1);
    transform: scale(1.05);
}

.btn-blog img {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.btn-blog:hover img {
    transform: rotate(15deg);
}

/* Responsive para móviles */
@media (max-width: 767px) {
    .btn-blog {
        padding: 0.75rem;
    }
    
    .btn-blog img {
        width: 20px;
        height: 20px;
    }
    
    /* Estilos responsive para el modal moderno */
    .modal-search-modern {
        max-width: 95%;
        margin: 1rem;
    }
    
    .modal-body-modern {
        padding: 50px 20px 30px;
    }
    
    .search-input-container {
        border-radius: 12px;
        padding: 3px;
    }
    
    .search-input-modern {
        padding: 14px 16px 14px 48px;
        font-size: 16px;
    }
    
    .search-icon {
        left: 16px;
        width: 18px;
        height: 18px;
    }
    
    .search-btn-modern {
        min-width: 44px;
        height: 44px;
        border-radius: 10px;
    }
    
    .btn-close-modern {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .modal-search-modern {
        max-width: 100%;
        margin: 0.5rem;
    }
    
    .modal-body-modern {
        padding: 45px 16px 25px;
    }
    
    .search-input-modern {
        font-size: 16px; /* Evita zoom en iOS */
    }
}