/**
 * Estilos para a página de Mais Vendidos (Redesign)
 * 
 * Design moderno inspirado na Amazon e OLX com foco em UX/UI
 * 100% responsivo para todos os dispositivos
 * 
 * @package Classi
 * @author Dev Team
 * @version 2.0.0
 * @created 07/04/2025
 */

/* 
 * Estilos gerais 
 * Define o container principal e cabeçalho da página
 */
.mais-vendidos-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Amazon Ember', Arial, sans-serif;
}

/* Cabeçalho da página */
.page-header {
    position: relative;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e7e7e7;
}

.page-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 5px;
    background: linear-gradient(to bottom, #6C3FA0, #F57C00);
    border-radius: 3px;
}

.page-header h1 {
    font-size: 28px;
    color: #333;
    font-weight: 600;
    margin: 0;
    padding-left: 15px;
}

.page-header p {
    color: #565959;
    font-size: 16px;
    margin-top: 5px;
    padding-left: 15px;
}

/* Layout principal */
.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

/* 
 * Sidebar de filtros 
 * Estilo inspirado na Amazon
 */
.filters-sidebar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.filter-group {
    border-bottom: 1px solid #e7e7e7;
    padding: 15px;
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-title {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
}

.filter-title i {
    margin-right: 8px;
    color: #6C3FA0;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 10px;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.category-link:hover {
    background-color: #f5f5f5;
    color: #F57C00;
}

.category-link.active {
    background-color: #f0f0f0;
    color: #6C3FA0;
    font-weight: 500;
}

.product-count {
    color: #777;
    font-size: 12px;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Filtro de preço */
.price-filter {
    margin-top: 15px;
}

.price-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.price-input-group {
    flex: 1;
}

.price-input-group label {
    display: block;
    font-size: 12px;
    color: #565959;
    margin-bottom: 5px;
}

.price-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #d5d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.price-slider {
    width: 100%;
    margin: 10px 0;
    -webkit-appearance: none;
    height: 4px;
    background: #d5d9d9;
    border-radius: 2px;
    outline: none;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6C3FA0;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.price-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6C3FA0;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.price-range-values {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #565959;
}

.apply-filter-btn {
    width: 100%;
    padding: 8px 0;
    background: #6C3FA0;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 10px;
}

.apply-filter-btn:hover {
    background: #5C2F90;
}

/* 
 * Conteúdo principal 
 */
.main-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Cabeçalho de resultados */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e7e7e7;
    background-color: #f9f9f9;
}

.results-count {
    font-size: 16px;
    color: #333;
}

.results-count strong {
    color: #6C3FA0;
}

.sort-options {
    display: flex;
    align-items: center;
}

.sort-options label {
    margin-right: 10px;
    font-size: 14px;
    color: #565959;
}

.sort-select {
    padding: 8px 30px 8px 10px;
    border: 1px solid #d5d9d9;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.view-options {
    display: flex;
    gap: 5px;
}

.view-option {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d5d9d9;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-option:hover {
    border-color: #6C3FA0;
    color: #6C3FA0;
}

.view-option.active {
    background: #6C3FA0;
    border-color: #6C3FA0;
    color: white;
}

/* Produtos em grade */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* Produtos em lista */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

/* Card de produto (estilo grade) */
.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.product-image-container {
    position: relative;
    padding-top: 100%; /* Proporção 1:1 */
    overflow: hidden;
    background-color: #f9f9f9;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #F57C00;
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 1;
    font-weight: 500;
}

.product-rank {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #6C3FA0;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    z-index: 1;
}

.product-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 14px;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 18px;
    color: #F57C00;
    font-weight: bold;
    margin-bottom: 8px;
}

.product-rating {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.product-stars {
    color: #FFD700;
    font-size: 12px;
    margin-right: 5px;
}

.product-reviews {
    font-size: 12px;
    color: #565959;
}

.product-sales {
    font-size: 12px;
    color: #565959;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.product-sales i {
    color: #6C3FA0;
    margin-right: 5px;
}

.product-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
}

.product-btn {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.product-btn i {
    margin-right: 5px;
}

.product-btn-primary {
    background: #6C3FA0;
    color: white;
}

.product-btn-primary:hover {
    background: #5C2F90;
}

.product-btn-secondary {
    background: #F57C00;
    color: white;
}

.product-btn-secondary:hover {
    background: #E56C00;
}

/* Card de produto (estilo lista) */
.product-card-list {
    display: flex;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.product-card-list:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.product-image-container-list {
    position: relative;
    width: 200px;
    min-width: 200px;
    background-color: #f9f9f9;
}

.product-image-list {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-content-list {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title-list {
    font-size: 16px;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.product-description {
    font-size: 14px;
    color: #565959;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.product-meta-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-meta-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.product-actions-list {
    margin-top: auto;
    display: flex;
    gap: 10px;
}

.product-btn-list {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* Paginação */
.pagination-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    border-top: 1px solid #e7e7e7;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d5d9d9;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #6C3FA0;
    color: #6C3FA0;
}

.pagination-btn.active {
    background: #6C3FA0;
    border-color: #6C3FA0;
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    color: #565959;
}

/* 
 * Modal de detalhes do produto
 * Janela flutuante com informações detalhadas do produto
 */
.product-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 1000px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e7e7e7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    color: #333;
    font-weight: 600;
    margin: 0;
}

.close-modal {
    font-size: 24px;
    color: #777;
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.close-modal:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-product {
    display: flex;
    gap: 30px;
}

.modal-gallery {
    flex: 1;
    max-width: 450px;
}

.modal-main-image {
    width: 100%;
    height: 350px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
}

.modal-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.modal-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.modal-thumbnail:hover {
    border-color: #d5d9d9;
}

.modal-thumbnail.active {
    border-color: #6C3FA0;
}

.modal-info {
    flex: 1;
}

.modal-product-title {
    font-size: 24px;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.modal-product-rating {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.modal-product-stars {
    color: #FFD700;
    font-size: 16px;
    margin-right: 8px;
}

.modal-product-reviews {
    font-size: 14px;
    color: #565959;
}

.modal-product-price {
    font-size: 28px;
    color: #F57C00;
    font-weight: bold;
    margin-bottom: 15px;
}

.modal-product-availability {
    font-size: 14px;
    color: #007600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.modal-product-availability i {
    margin-right: 5px;
}

.modal-product-sales {
    font-size: 14px;
    color: #565959;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.modal-product-sales i {
    color: #6C3FA0;
    margin-right: 5px;
}

.modal-product-description {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.modal-product-features {
    margin-bottom: 20px;
}

.modal-product-features h4 {
    font-size: 16px;
    color: #333;
    margin: 0 0 10px 0;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
    padding-left: 20px;
    position: relative;
}

.features-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #6C3FA0;
    font-size: 18px;
    line-height: 1;
}

.modal-product-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.modal-product-btn {
    flex: 1;
    padding: 12px 0;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-product-btn i {
    margin-right: 8px;
}

.modal-product-btn-primary {
    background: #6C3FA0;
    color: white;
}

.modal-product-btn-primary:hover {
    background: #5C2F90;
}

.modal-product-btn-secondary {
    background: #F57C00;
    color: white;
}

.modal-product-btn-secondary:hover {
    background: #E56C00;
}

/* Responsividade */
@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 240px 1fr;
    }
    
    .modal-product {
        flex-direction: column;
    }
    
    .modal-gallery {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
        border-radius: 0;
        overflow-y: auto;
    }
    
    .filters-sidebar.active {
        display: block;
    }
    
    .filter-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
        border-bottom: 1px solid #e7e7e7;
        background-color: #f9f9f9;
    }
    
    .filter-mobile-title {
        font-size: 18px;
        color: #333;
        font-weight: 600;
        margin: 0;
    }
    
    .close-filter-btn {
        font-size: 24px;
        color: #777;
        cursor: pointer;
        background: none;
        border: none;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
    }
    
    .mobile-filter-btn {
        display: flex;
        align-items: center;
        padding: 8px 15px;
        background: #6C3FA0;
        color: white;
        border: none;
        border-radius: 4px;
        font-size: 14px;
        cursor: pointer;
        margin-right: 10px;
    }
    
    .mobile-filter-btn i {
        margin-right: 5px;
    }
    
    .results-header {
        flex-wrap: wrap;
    }
    
    .results-count {
        order: 1;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .sort-options {
        order: 2;
    }
    
    .view-options {
        order: 3;
    }
    
    .product-card-list {
        flex-direction: column;
    }
    
    .product-image-container-list {
        width: 100%;
        height: 200px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        padding: 15px;
    }
    
    .product-title {
        font-size: 13px;
        height: 36px;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .pagination-btn {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .modal-product-actions {
        flex-direction: column;
    }
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-in-out;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-in-out;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
}

.skeleton-image {
    height: 180px;
    margin-bottom: 15px;
}

.skeleton-title {
    height: 16px;
    margin-bottom: 10px;
    width: 80%;
}

.skeleton-price {
    height: 20px;
    margin-bottom: 10px;
    width: 50%;
}

.skeleton-text {
    height: 12px;
    margin-bottom: 8px;
    width: 70%;
}

.skeleton-button {
    height: 36px;
    margin-top: 15px;
}
