/*
 * PRODUTOS POR CATEGORIA - Seção após Banner Secundário
 * 4 produtos por linha com link "Veja mais" ao final
 */

/* ==================== SEÇÃO PRINCIPAL ==================== */

.products-by-category-section {
    width: 100% !important;
    padding: 4rem 0 !important;
    background-color: #f8f9fa !important;
    position: relative !important;
}

.products-by-category-section .container {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 0 2rem !important;
}

/* ==================== LINHA DE CATEGORIA ==================== */

.category-products-row {
    margin-bottom: 4rem !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.category-products-row:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
}

.category-products-row:last-child {
    margin-bottom: 0 !important;
}

/* ==================== CABEÇALHO DA CATEGORIA ==================== */

.category-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 2rem 2.5rem 1.5rem 2.5rem !important;
    border-bottom: 1px solid #e9ecef !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
}

.category-title {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    color: #333333 !important;
    margin: 0 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    position: relative !important;
}

.category-title::after {
    content: '' !important;
    position: absolute !important;
    bottom: -8px !important;
    left: 0 !important;
    width: 60px !important;
    height: 3px !important;
    background: linear-gradient(135deg, #e4002b 0%, #c8002a 100%) !important;
    border-radius: 2px !important;
}

.see-more-link {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0.75rem 1.5rem !important;
    background: linear-gradient(135deg, #e4002b 0%, #c8002a 100%) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 25px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 10px rgba(228, 0, 43, 0.3) !important;
    position: relative !important;
    overflow: hidden !important;
}

.see-more-link::before {
    content: '→' !important;
    margin-left: 0.5rem !important;
    transition: transform 0.3s ease !important;
}

.see-more-link:hover {
    background: linear-gradient(135deg, #c8002a 0%, #a50023 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(228, 0, 43, 0.4) !important;
    color: #ffffff !important;
}

.see-more-link:hover::before {
    transform: translateX(3px) !important;
}

/* ==================== GRID DE PRODUTOS ==================== */

.products-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.5rem !important;
    padding: 2.5rem !important;
}

/* ==================== CARTÃO DO PRODUTO ==================== */

.product-card {
    background: #ffffff !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    border: 1px solid #e9ecef !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
}

.product-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1) !important;
    border-color: #e4002b !important;
}

.product-link {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    text-decoration: none !important;
    color: inherit !important;
}

.product-link:hover {
    text-decoration: none !important;
    color: inherit !important;
}

/* ==================== IMAGEM DO PRODUTO ==================== */

.product-image {
    position: relative !important;
    width: 100% !important;
    height: 200px !important;
    overflow: hidden !important;
    background-color: #f8f9fa !important;
}

.product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: transform 0.4s ease !important;
}

.product-card:hover .product-image img {
    transform: scale(1.05) !important;
}

.sale-badge {
    position: absolute !important;
    top: 0.75rem !important;
    right: 0.75rem !important;
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%) !important;
    color: #ffffff !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 4px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    z-index: 2 !important;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3) !important;
}

/* ==================== INFORMAÇÕES DO PRODUTO ==================== */

.product-info {
    padding: 1rem !important;
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

.product-name {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #333333 !important;
    margin: 0 0 0.75rem 0 !important;
    line-height: 1.3 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.product-price {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
}

.price {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #e4002b !important;
}

.price-original {
    font-size: 0.85rem !important;
    color: #999999 !important;
    text-decoration: line-through !important;
    font-weight: 400 !important;
}

.price-sale {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #e4002b !important;
}

/* ==================== BOTÃO WISHLIST ==================== */

.wishlist-btn {
    position: absolute !important;
    top: 0.75rem !important;
    left: 0.75rem !important;
    width: 32px !important;
    height: 32px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    z-index: 3 !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.wishlist-btn:hover {
    background: #e4002b !important;
    color: #ffffff !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(228, 0, 43, 0.3) !important;
}

.wishlist-btn.active {
    background: #e4002b !important;
    color: #ffffff !important;
}

.wishlist-btn svg {
    width: 16px !important;
    height: 14px !important;
    transition: all 0.3s ease !important;
}

.wishlist-btn:hover svg {
    fill: currentColor !important;
}

/* ==================== RESPONSIVIDADE ==================== */

/* Tablet Grande */
@media (max-width: 1200px) {
    .products-by-category-section .container {
        padding: 0 1.5rem !important;
    }
    
    .products-grid {
        gap: 1.25rem !important;
        padding: 2rem !important;
    }
    
    .category-header {
        padding: 1.75rem 2rem 1.25rem 2rem !important;
    }
    
    .category-title {
        font-size: 1.5rem !important;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1rem !important;
    }
    
    .product-image {
        height: 180px !important;
    }
    
    .category-title {
        font-size: 1.4rem !important;
    }
    
    .see-more-link {
        padding: 0.625rem 1.25rem !important;
        font-size: 0.85rem !important;
    }
}

/* Tablet Pequeno */
@media (max-width: 768px) {
    .products-by-category-section {
        padding: 3rem 0 !important;
    }
    
    .products-by-category-section .container {
        padding: 0 1rem !important;
    }
    
    .category-products-row {
        margin-bottom: 3rem !important;
        border-radius: 8px !important;
    }
    
    .category-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
        padding: 1.5rem !important;
    }
    
    .category-title {
        font-size: 1.25rem !important;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.875rem !important;
        padding: 1.5rem !important;
    }
    
    .product-image {
        height: 160px !important;
    }
    
    .product-name {
        font-size: 0.85rem !important;
    }
    
    .price, .price-sale {
        font-size: 1rem !important;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .products-by-category-section {
        padding: 2rem 0 !important;
    }
    
    .category-products-row {
        margin-bottom: 2rem !important;
    }
    
    .category-header {
        padding: 1.25rem !important;
    }
    
    .category-title {
        font-size: 1.1rem !important;
    }
    
    .see-more-link {
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        padding: 1.25rem !important;
    }
    
    .product-image {
        height: 140px !important;
    }
    
    .product-info {
        padding: 0.75rem !important;
    }
    
    .product-name {
        font-size: 0.8rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .price, .price-sale {
        font-size: 0.9rem !important;
    }
    
    .price-original {
        font-size: 0.75rem !important;
    }
    
    .wishlist-btn {
        width: 28px !important;
        height: 28px !important;
        top: 0.5rem !important;
        left: 0.5rem !important;
    }
    
    .wishlist-btn svg {
        width: 14px !important;
        height: 12px !important;
    }
    
    .sale-badge {
        top: 0.5rem !important;
        right: 0.5rem !important;
        padding: 0.2rem 0.4rem !important;
        font-size: 0.65rem !important;
    }
}

/* ==================== ANIMAÇÕES ==================== */

/* Animação de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-products-row {
    animation: fadeInUp 0.6s ease-out !important;
    animation-fill-mode: both !important;
}

.category-products-row:nth-child(2) {
    animation-delay: 0.1s !important;
}

.category-products-row:nth-child(3) {
    animation-delay: 0.2s !important;
}

.category-products-row:nth-child(4) {
    animation-delay: 0.3s !important;
}

/* Animação dos produtos */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.product-card {
    animation: fadeInScale 0.4s ease-out !important;
    animation-fill-mode: both !important;
}

.product-card:nth-child(1) { animation-delay: 0.1s !important; }
.product-card:nth-child(2) { animation-delay: 0.2s !important; }
.product-card:nth-child(3) { animation-delay: 0.3s !important; }
.product-card:nth-child(4) { animation-delay: 0.4s !important; }

/* ==================== OTIMIZAÇÕES DE PERFORMANCE ==================== */

.product-image img,
.product-card,
.see-more-link,
.wishlist-btn {
    will-change: transform !important;
    backface-visibility: hidden !important;
    transform: translateZ(0) !important;
}

/* ==================== ACESSIBILIDADE ==================== */

.product-link:focus {
    outline: 2px solid #e4002b !important;
    outline-offset: 2px !important;
}

.see-more-link:focus {
    outline: 2px solid #ffffff !important;
    outline-offset: 2px !important;
}

.wishlist-btn:focus {
    outline: 2px solid #e4002b !important;
    outline-offset: 2px !important;
}

/* Redução de movimento para acessibilidade */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .category-products-row,
    .product-image img,
    .see-more-link,
    .wishlist-btn {
        animation: none !important;
        transition: none !important;
    }
}
