/*
Theme Name: GeneratePress Child
Theme URI: https://generatepress.com
Author: Tom Usborne
Author URI: https://tomusborne.com
Description: Child theme for GeneratePress
Template: generatepress
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: generatepress-child
*/

/* Estilos para otimização de imagens */
.woocommerce-product-gallery.optimized {
    opacity: 1 !important;
    transition: none !important;
}

body.scrolling .woocommerce-product-gallery__wrapper {
    transition: none !important;
    will-change: auto !important; /* Desativa will-change durante scroll para melhor performance */
}

body.scrolling .flex-control-thumbs img {
    transition: none !important;
}

/* Layout skeleton para melhorar LCP */
.woocommerce-product-gallery__wrapper::before {
    content: '';
    display: block;
    width: 100%;
    padding-top: 100%; /* Preserva a proporção */
    background-color: #f9f9f9;
}

.woocommerce-product-gallery__wrapper.loaded::before {
    display: none;
}

/* Otimização específica para imagens de produto */
.woocommerce-product-gallery__image {
    position: relative;
    transition: opacity 0.3s ease;
}

.woocommerce-product-gallery__image img {
    opacity: 1 !important;
    transition: opacity 0.2s ease-in-out;
}

/* ========================================
   ESTILOS PARA PÁGINA DE CATEGORIAS/JOGOS
   ======================================== */

/* Título da categoria */
.category-title {
    position: relative;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(45deg, #28a745, #20c997);
    border-radius: 2px;
}

/* Descrição da categoria */
.category-description {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Sidebar de filtros */
.woocommerce-filters {
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    position: sticky;
    top: 20px;
}

.filter-mob {
    color: #495057;
    font-weight: 600;
    font-size: 1.2rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-section {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.filter-title {
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.filter-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(45deg, #28a745, #20c997);
    margin-right: 0.5rem;
    border-radius: 2px;
}

/* Links de filtro */
.filter-link {
    color: #495057;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.filter-link:hover {
    background: #e3f2fd;
    color: #1976d2;
    text-decoration: none;
    transform: translateX(5px);
}

.filter-link i {
    transition: all 0.3s ease;
}

.filter-link:hover i {
    transform: scale(1.1);
}

.count {
    margin-left: auto;
    background: #e9ecef;
    color: #6c757d;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Área de produtos */
.count-ordering {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

/* Produtos grid responsivo */
#product-list .col-xl-4,
#product-list .col-xl-3 {
    margin-bottom: 2rem;
}

/* Mobile responsivo */
@media (max-width: 991px) {
    .woocommerce-filters {
        position: static;
        margin-bottom: 2rem;
    }
    
    #filter-mob {
        display: none;
    }
    
    .filter-mob {
        cursor: pointer;
        user-select: none;
    }
    
    .filter-mob:hover {
        color: #28a745;
    }
    
    .category-title {
        font-size: 2rem;
        text-align: center;
    }
    
    .category-description {
        text-align: center;
        margin-bottom: 2rem;
    }
}

@media (max-width: 576px) {
    .category-title {
        font-size: 1.75rem;
    }
    
    .filter-section {
        padding: 0.75rem;
    }
    
    .filter-link {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
}

/* Animações para melhorar UX */
.filter-section {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Melhorias no layout de produtos */
.woocommerce .products .product {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.woocommerce .products .product:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Estilo para links de jogos específicos */
.jogos-breadcrumb {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #2196f3;
}

.jogos-breadcrumb p {
    margin: 0;
    color: #495057;
    font-weight: 500;
}

.jogos-breadcrumb a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 600;
}

.jogos-breadcrumb a:hover {
    text-decoration: underline;
}

/* Evita flash durante o carregamento */
img.attachment-woocommerce_thumbnail,
img.attachment-woocommerce_single,
img.attachment-shop_catalog {
    background-color: #f9f9f9; /* Cor de fundo enquanto carrega */
    transition: opacity 0.3s ease;
}

/* Remove loader de produtos */
.woocommerce ul.products li.product a img {
    margin: 0;
}

/* Otimização de carregamento de imagens */
body.images-preloaded .woocommerce-product-gallery::before {
    display: none !important;
    opacity: 0 !important;
}

/* Melhora o carregamento inicial */
.woocommerce-product-gallery {
    min-height: 400px;
    background-color: #fff;
}

/* ==========================================================================
   PRODUCT TABS - LAYOUT ELEGANTE
   ========================================================================== */

.playludico-product-tabs {
    margin-top: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Navegação das Tabs */
.playludico-tabs-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    position: relative;
    list-style: none;
    padding: 0;
}

.playludico-tabs-nav li {
    flex: 1;
    text-align: center;
    margin: 0;
    padding: 0;
}

.playludico-tabs-nav .tab-link {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 0;
    color: rgba(255,255,255,0.7);
    font-weight: 600;
    font-size: 16px;
    padding: 20px 15px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}

/* Adiciona pseudo-elemento para extensão sempre presente mas invisível */
.playludico-tabs-nav .tab-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0 0 2px 2px;
    transition: height 0.3s ease, bottom 0.3s ease;
}

.playludico-tabs-nav .tab-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    text-decoration: none;
}

.playludico-tabs-nav li.active .tab-link {
    color: #fff;
    background: transparent;
    box-shadow: inset 0 -4px 0 #fff;
    font-weight: 700;
}

/* Efeito visual mais claro para tab ativa */
.playludico-tabs-nav li.active .tab-link {
    background: rgba(255,255,255,0.1) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    transform: translateY(-1px);
    position: relative;
}

/* Extensão visível apenas na aba ativa */
.playludico-tabs-nav li.active .tab-link::after {
    height: 4px !important;
    bottom: -4px !important;
}

/* ==========================================================================
   EFEITO VISUAL DAS TABS: ATIVA vs INATIVA
   
   - Tab ATIVA: Extensão colorida (gradiente) = aparenta estar "estendida"
   - Tab INATIVA: Borda branca = aparenta estar "recolhida"
   
   Isso cria uma hierarquia visual clara onde a aba ativa se destaca.
   ========================================================================== */

/* Ajusta o container das tabs para acomodar a extensão */
.playludico-tabs-nav {
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

/* Garante que a extensão da aba ativa se conecte com o conteúdo */
.playludico-product-tabs .woocommerce-Tabs-panel {
    margin-top: -1px;
    position: relative;
    z-index: 1;
}

/* Padding do conteúdo das tabs */
.tab-content-wrapper {
    padding: 40px 60px;
}

/* ==========================================================================
   PADDING RESPONSIVO PARA CONTEÚDO DAS TABS
   
   - Desktop: 40px vertical, 60px horizontal (espaço generoso)
   - Tablet: 30px vertical, 40px horizontal (reduzido proporcionalmente)
   - Mobile: 20px vertical, 25px horizontal (compacto para telas pequenas)
   ========================================================================== */

/* ==========================================================================
   RESPONSIVIDADE PARA TABS ELEGANTES
   ========================================================================== */

/* Tablet */
@media (max-width: 768px) {
    .playludico-tabs-nav {
        flex-direction: column;
    }
    
    .playludico-tabs-nav li {
        flex: none;
        width: 100%;
    }
    
    .playludico-tabs-nav .tab-link {
        padding: 15px;
        font-size: 14px;
    }
    
    /* Ajusta a extensão da aba ativa no tablet */
    .playludico-tabs-nav li.active .tab-link::after {
        height: 3px;
        bottom: -3px;
    }
    
    /* Ajusta borda das tabs inativas no tablet */
    .playludico-tabs-nav li:not(.active) .tab-link::after {
        height: 1.5px !important;
        bottom: -1.5px !important;
    }
    
    .tab-content-wrapper {
        padding: 30px 40px;
    }
    
    .playludico-product-tabs {
        margin-top: 20px;
        border-radius: 8px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .playludico-tabs-nav .tab-link {
        flex-direction: column;
        gap: 4px;
        padding: 12px;
    }
    
    .tab-icon {
        font-size: 20px;
    }
    
    /* Extensão menor no mobile */
    .playludico-tabs-nav li.active .tab-link::after {
        height: 2px;
        bottom: -2px;
    }
    
    /* Borda das tabs inativas no mobile */
    .playludico-tabs-nav li:not(.active) .tab-link::after {
        height: 1px !important;
        bottom: -1px !important;
    }
    
    .playludico-tabs-nav li.active .tab-link:hover::after {
        height: 3px;
        bottom: -3px;
    }
    
    /* Padding menor para mobile */
    .tab-content-wrapper {
        padding: 20px 25px;
    }
    
    /* Tab inativa com background mais opaco */
.playludico-tabs-nav li:not(.active) .tab-link {
    background: rgba(255,255,255,0.3) !important;
    color: rgba(255,255,255,0.8);
}

/* Adiciona borda branca na tab inativa para efeito "recolhida" */
.playludico-tabs-nav li:not(.active) .tab-link::after {
    height: 2px !important;
    bottom: -2px !important;
    background: #fff !important;
    opacity: 0.8;
}

/* Melhora o contraste visual das tabs inativas */
.playludico-tabs-nav li:not(.active) .tab-link {
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.2);
}

/* Hover da tab inativa mantém a borda branca */
.playludico-tabs-nav li:not(.active) .tab-link:hover::after {
    opacity: 1;
    background: #fff !important;
}

/* Remove também títulos dentro do wrapper */
.tab-content-wrapper > h2:first-child,
.tab-content-wrapper > h3:first-child {
    display: none !important;
}

/* Remove ratings duplicados nas tabs */
.playludico-product-tabs .woocommerce-Tabs-panel .woocommerce-product-rating:not(:first-child) {
    display: none !important;
}

/* Remove ratings duplicados na product-summary - Mantém apenas o primeiro */
.product-summary .woocommerce-product-rating ~ .woocommerce-product-rating {
    display: none !important;
}

/* Remove possível rating padrão do WooCommerce na summary */
.product-summary .star-rating ~ .woocommerce-product-rating,
.single-product-summary .star-rating ~ .woocommerce-product-rating {
    display: none !important;
}

/* Esconde rating que pode aparecer após o formulário */
.product-summary form.cart ~ .woocommerce-product-rating {
    display: none !important;
}

/* Remove estrelas duplicadas na aba de avaliações */
