/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Seção de Filtros */
.filters-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.search-container {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #5a6fd8;
    transform: translateY(-50%) scale(1.05);
}

.filter-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-success {
    font-weight: bold;
    padding: 12px 20px;
    color: #fff;
    background-color: #198754;
    border-color: #198754;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: #157347;
    color: #fff;
    border-color: #198754;
    transform: translateY(-2px);
}

.clear-btn {
    padding: 12px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Grid de Produtos */
.products-section {
    margin-bottom: 40px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border: 2px solid #000;
}

.product-image {
    width: 100%;
    height: 200px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.25);
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-image::before {
    opacity: 1;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
    line-height: 1.4;
}

.product-category {
    font-size: 0.9rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 10px;
}

.product-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 1000px;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
    margin-top: 0.2rem;
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #000;
    background: white;
    transform: scale(1.1);
}

.modal-body {
    display: flex;
    flex-direction: column;
}

/* Seção de Imagens do Modal */
.modal-image-section {
    width: 100%;
    background: #f8f9fa;
}

.modal-image-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    text-align: center;
}

/* Botões de Navegação das Imagens */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.nav-btn svg {
    color: #333;
}

/* Container de Thumbnails */
.thumbnail-container {
    display: flex;
    gap: 10px;
    padding: 20px;
    justify-content: center;
    flex-wrap: wrap;
    background: white;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: #667eea;
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

/* Informações do Modal */
.modal-info {
    padding: 30px;
}

#modalTitle {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.3;
}

.modal-category {
    font-size: 1rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 25px;
    display: inline-block;
}

.modal-description,
.modal-specifications {
    margin-bottom: 25px;
}

.modal-description h3,
.modal-specifications h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.modal-description p {
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-label {
    font-weight: 600;
    color: #2c3e50;
}

.spec-value {
    color: #666;
    text-align: right;
}

/* Mensagem de "Nenhum resultado" */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.no-results h3 {
    font-size: 1.5rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.no-results p {
    color: #999;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 1.1rem;
    color: #666;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .filters-section {
        padding: 20px;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select {
        min-width: auto;
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-image-container {
        height: 250px;
    }
    
    .modal-info {
        padding: 20px;
    }
    
    #modalTitle {
        font-size: 1.5rem;
    }
    
    .spec-item {
        flex-direction: column;
        gap: 5px;
    }
    
    .spec-value {
        text-align: left;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
    
    .thumbnail {
        width: 60px;
        height: 45px;
    }
    
    .thumbnail-container {
        padding: 15px;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        top: 0;
        width: 98%;
        margin: 1% auto;
        max-height: 98vh;
    }
    
    .modal-image-container {
        height: 200px;
    }
    
    .thumbnail {
        width: 50px;
        height: 38px;
    }
}

/* Animações adicionais */
.product-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Delay escalonado para as animações dos cards */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
.product-card:nth-child(7) { animation-delay: 0.7s; }
.product-card:nth-child(8) { animation-delay: 0.8s; }
.product-card:nth-child(9) { animation-delay: 0.9s; }
.product-card:nth-child(n+10) { animation-delay: 1s; }

/* Animações para as imagens do modal */
.modal-image-container img {
    animation: imageSlideIn 0.4s ease;
}

@keyframes imageSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Efeitos hover para thumbnails */
.thumbnail-container {
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f1f1;
}

.thumbnail-container::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.thumbnail-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.thumbnail-container::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}
