/* Mobile Responsive Styles - Hamburguer Menu Version */
html, body {
    overflow-x: hidden !important;
    width: 100vw;
    max-width: 100%;
    position: relative;
}

/* Desktop Only Elements - Hidden on Mobile */
@media (max-width: 992px) {
    .desktop-only,
    .main-header.header-scrolled .header-bottom.desktop-only {
        display: none !important;
    }
}

/* Base Mobile Styles */
.mobile-menu-btn {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    color: #000;
    padding: 5px;
}

.mobile-drawer {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 90%;
    max-width: 400px;
    height: 100vh;
    background: #fff;
    z-index: 2000;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-direction: column;
    overflow: hidden;
}

.mobile-drawer.active {
    transform: translateX(0);
}

.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Drawer Content */
.drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-title {
    font-family: 'Hepta Slab', serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.close-drawer-btn {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.drawer-section {
    margin-bottom: 2.5rem;
}

.drawer-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Styles inside Drawer */
.drawer-filters.category-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2 colunas */
    gap: 0.8rem;
    width: 100%;
}

.drawer-filters .chip {
    width: 100%;
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
}

.drawer-timeline.timeline-nav {
    display: grid !important;
    grid-template-columns: 1fr !important;
    /* 1 coluna para acomodar o acordeão sem quebrar o layout */
    gap: 0.8rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    height: auto !important;
}

.drawer-timeline .timeline-item {
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid #eee !important;
    border-radius: 4px !important;
    padding: 0 !important; /* Padding removido do container para facilitar o clique no link */
    text-align: center !important;
    min-width: 0 !important;
    overflow: hidden !important;
    height: auto !important;
    transition: all 0.3s ease;
}

.drawer-timeline .timeline-link,
.drawer-timeline .timeline-link:hover,
.drawer-timeline .timeline-link:active,
.drawer-timeline .timeline-link:focus,
.drawer-timeline .timeline-item.active .timeline-link,
.drawer-timeline .timeline-item.active .timeline-link:hover {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 1rem !important;
    padding: 1rem !important;
    color: #000 !important; /* Sempre preto */
    background: transparent !important; /* Reseta o fundo preto do desktop em qualquer estado */
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.drawer-timeline .timeline-item.expanded {
    background-color: #f8f9fa !important; /* Fundo cinza clarinho para destacar o acordeão aberto */
    border-color: #ddd !important;
}

.drawer-timeline .timeline-item.expanded .timeline-link {
    color: #000 !important;
    font-weight: 700 !important;
}

.drawer-timeline .timeline-item.expanded .arrow-icon {
    transform: rotate(90deg); /* Aponta para baixo */
}

.drawer-timeline .arrow-icon {
    transition: transform 0.3s ease;
}

/* Esconde o menu dropdown padrão do desktop no mobile */
.drawer-timeline .dropdown-menu {
    display: none !important;
}

/* Estiliza o conteúdo do acordeão mobile (os cards brancos) */
.drawer-timeline .accordion-content {
    background-color: transparent !important;
    padding: 0 1rem 1rem 1rem !important;
    display: none; /* Controlado pelo JS */
    width: 100% !important;
    box-sizing: border-box !important;
}

.drawer-timeline .accordion-content .submenu-year-card {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.8rem !important;
    margin-bottom: 0.5rem !important;
    border-radius: 6px !important;
    background-color: #ffffff !important; /* Card branco */
    color: #333 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    border: 1px solid #eaeaea !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
}

.drawer-timeline .accordion-content .submenu-year-card:last-child {
    margin-bottom: 0 !important;
}

.drawer-timeline .accordion-content .submenu-year-card.active {
    background-color: var(--color-bg) !important; /* Destaque preto para o ano ativo */
    color: #ffffff !important;
    border-color: var(--color-bg) !important;
}

.drawer-timeline .accordion-content .submenu-year-card.locked {
    background-color: #f5f5f5 !important;
    color: #999 !important;
    border-color: #eee !important;
}

.drawer-timeline .timeline-label {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Search in Drawer */
.drawer-search .search-container {
    width: 100%;
    max-width: 100%;
    background: #f5f5f5;
    padding: 0.8rem 1rem;
}

/* DRAWER SUBMENU (NEW) */
.drawer-submenu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 2005;
    /* Above standard drawer content */
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.drawer-submenu.active {
    transform: translateX(0);
}

.back-drawer-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.back-drawer-btn:hover {
    color: #000;
}

.submenu-years-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns for years */
    gap: 1rem;
    padding-bottom: 2rem;
}

.submenu-year-card {
    background: #f8f8f8;
    border: 1px solid #eee;
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.submenu-year-card.active {
    background: #181818;
    color: #fff;
    border-color: #181818;
}

.submenu-year-card.locked {
    cursor: not-allowed;
    background: #fdfdfd;
    border-color: #eee;
    color: #999;
}

.submenu-year-card:not(.locked):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.submenu-year-card .year-label {
    font-family: 'Hepta Slab', serif;
    font-weight: 700;
    font-size: 1.1rem;
}

.submenu-year-card .year-arrow {
    width: 20px;
    height: 20px;
    opacity: 0.3;
}

.submenu-year-card.active .year-arrow {
    opacity: 1;
}

/* Use native accordion instead of hiding dropdowns */
.drawer-timeline .dropdown-menu {
    display: none !important; /* Hide by default, shown when .expanded is applied to parent */
}

.drawer-timeline .timeline-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 100%;
    color: #333;
    font-weight: 600;
    text-decoration: none;
}

.drawer-timeline .arrow-icon {
    display: inline-block;
    transform: rotate(270deg);
    /* Point right */
    width: 14px;
    height: 14px;
    opacity: 0.5;
}


/* Responsive Trigger */
@media (max-width: 992px) {
    .mobile-menu-btn {
        display: block;
    }

    .main-header {
        position: fixed;
        /* Stick header */
    }

    .header-top {
        padding: 0.8rem 1.2rem;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        display: flex;
        flex-direction: row;
    }

    #site-logo {
        height: 40px;
    }

    /* Ensure drawer is visible on mobile interactively */
    .mobile-drawer {
        display: flex;
        /* But hidden by translate */
    }
}

/* Fix Hero Section for Mobile */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        margin: 0 auto;
        padding: 0 1.5rem;
        text-align: center;
    }

    .hero-content {
        text-align: center;
    }

    .hero-content h1 {
        font-size: clamp(2.2rem, 8vw, 3rem);
        margin-left: 0;
        word-break: keep-all;
    }

    .hero-tag {
        font-size: 0.7rem;
        margin-left: 0;
        margin-bottom: 1rem;
    }

    .subtitle {
        font-size: 1.35rem;
        line-height: 1.4;
        padding: 0 10px;
    }

    /* Ajustes da Página da Temporada */
    .season-title span {
        font-size: clamp(3rem, 12vw, 4rem) !important;
    }

    .season-intro {
        padding: 0 2rem;
    }

    /* Centralizar setas de navegação verticalmente (agora que há espaço no meio) */
    .season-navigation {
        position: fixed !important;
        top: 50% !important;
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        transform: translateY(-50%) !important;
        padding: 0 !important;
        display: block !important; /* Mudar para block para posicionamento absoluto robusto */
        pointer-events: none !important;
        z-index: 1000 !important; /* Garante que fique acima de outras camadas */
    }

    .nav-arrow {
        position: absolute !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        pointer-events: auto !important;
        min-width: 16px !important;
        width: 16px !important;
        height: 50px !important; /* Mantém a altura para não dificultar o toque */
        background: rgba(255, 255, 255, 0.1) !important; /* Fundo sutil */
        backdrop-filter: blur(4px) !important;
        justify-content: center !important;
        padding: 0 !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .nav-arrow.prev {
        left: 0 !important;
        border-radius: 0 10px 10px 0 !important; /* Arredondado apenas do lado de dentro (direito) */
        border-left: none !important;
    }

    .nav-arrow.next {
        right: 0 !important;
        border-radius: 10px 0 0 10px !important; /* Arredondado apenas do lado de dentro (esquerdo) */
        border-right: none !important;
    }

    .nav-arrow:hover, .nav-arrow:active {
        background: rgba(255, 255, 255, 0.25) !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
    }

    .nav-arrow .arrow-svg {
        width: 10px !important;
        height: 20px !important;
        stroke-width: 3 !important; /* Aumenta a espessura para ser legível pequena */
        transform: none !important; /* Remove translação que tiraria do centro */
    }

    .nav-arrow.prev:hover .arrow-svg,
    .nav-arrow.next:hover .arrow-svg {
        transform: none !important; /* Previne que saia do botão no hover */
    }


    /* Otimizar o uso do espaço: aumentar a imagem e reduzir espaços em branco */
    .season-hero {
        padding-top: 0 !important; /* Remove os 200px absurdos do style.css no mobile */
        min-height: 80vh !important;
        height: auto !important;
    }

    .season-hero-container {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding-top: 5vh !important; /* Espaço do topo menor */
        gap: 1rem !important; 
    }

    .season-info {
        margin-bottom: 0 !important;
        flex: 0 0 auto !important;
    }

    .season-player {
        height: 55vh !important; /* Container da imagem um pouco maior */
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: flex-end !important;
        margin-top: auto !important; /* Empurra a imagem pro final se houver espaço */
        flex: 0 0 auto !important;
    }

    .player-img {
        height: 100% !important; /* Ocupar todo o container */
        max-height: 600px !important; /* Sobrescreve o max-height restritivo do style.css */
        width: 100% !important; /* Usa 100% e object-fit para nunca vazar a largura da tela */
        object-fit: contain !important;
        transform: translateY(0) !important;
    }

    /* Consertar o Jersey Spotlight (Camisa atrás, jogador na frente) */
    .jersey-preview-large {
        position: relative !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        height: 50vh !important; /* Diminuído para centralizar melhor no bloco */
        flex-direction: row !important;
        transform: translateY(-10%) !important; /* Sobe o bloco todo das duas imagens */
    }

    .main-jersey-img {
        position: absolute !important;
        height: 75% !important; /* Camisa aumentada */
        max-height: none !important;
        width: auto !important;
        z-index: 1 !important;
        margin: 0 !important;
        object-fit: contain !important;
        transform: translate(28%, -15%) !important; /* Desceu um pouco a pedido */
    }

    .spotlight-player {
        position: absolute !important; 
        height: 85% !important; 
        max-height: none !important;
        z-index: 2 !important;
        margin: 0 !important;
        transform: translate(-25%, 5%) !important; /* Mais pra esquerda */
    }

    .spotlight-player img {
        height: 100% !important;
        max-height: none !important;
        width: auto !important;
    }

    /* Diagramação dos blocos de texto (Variations) */
    .spotlight-details {
        margin-top: -5% !important; /* Aproxima os textos das imagens */
        margin-left: 0 !important; /* Remove o deslocamento para a esquerda do desktop */
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .variations-board {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem !important;
        margin-top: 0.5rem !important;
        align-items: start !important;
        width: 100% !important;
    }

    .variation-item {
        padding: 0 !important;
        text-align: center !important;
    }

    /* ========================================== */
    /* NOVA REGULAGEM DAS VARIAÇÕES (MOBILE)      */
    /* ========================================== */
    
    #variacoes-camisa, #variacoes-short, #variacoes-meiao {
        padding: 0.5rem 1rem 0 1rem !important;
    }
    
    .match-history-list {
        gap: 0.5rem !important;
    }
    
    .history-item.active {
        display: grid !important;
        grid-template-columns: repeat(12, 1fr) !important;
        row-gap: 0 !important;
        column-gap: 0.5rem !important;
        align-items: center !important;
        text-align: center !important;
        padding: 0.5rem !important; /* Padding reduzido para diminuir espaços superior e inferior */
    }
    
    /* Faz as linhas intermediárias sumirem para que os filhos virem itens diretos do grid principal */
    .history-row-mid,
    .history-row-base {
        display: contents !important;
    }
    
    .history-row-top {
        display: flex !important;
        flex-direction: row !important;
        height: auto !important;
        gap: 1.2rem !important;
        align-items: center !important;
        justify-content: flex-start !important;
        grid-column: span 12 !important;
        order: 0 !important;
        margin: 0 !important;
        text-align: left !important;
        z-index: 10 !important; /* Garante que o texto fique clicável se a imagem sobrepor */
    }
    
    .history-number {
        font-size: 5rem !important;
        margin: 0 !important;
        height: auto !important;
        line-height: 1 !important;
        position: static !important;
        flex-shrink: 0 !important;
    }
    
    .history-header-top {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .match-date {
        font-size: 1.15rem !important; /* Reduzido para caber em uma única linha no mobile */
        white-space: nowrap !important; /* Impede a quebra da data */
        font-weight: 700 !important;
        line-height: 1.2 !important;
        margin-bottom: 0.15rem !important;
        text-align: left !important;
    }
    
    .match-title {
        font-size: 0.9rem !important;
        color: #666 !important;
        text-align: left !important;
        margin: 0 !important;
    }
    
    /* Elementos do Row Mid */
    
    /* Coluna Jogador */
    .col-player {
        grid-column: 1 / -1 !important; /* Ocupa a largura total para remover limites e permitir crescimento */
        grid-row: 2 !important; /* Força ficar na mesma linha horizontal das camisas */
        order: 1 !important;
        z-index: 5 !important; /* IMPORTANTE: Fica na frente das camisas (z-index maior) */
        display: flex !important;
        flex-direction: row !important; /* IMPORTANTE: força row para alinhar horizontalmente na esquerda e verticalmente embaixo */
        align-items: flex-end !important;
        justify-content: flex-start !important;
        margin: 0 !important;
        min-width: 0 !important;
        width: 100% !important;
    }
    
    .player-cutout {
        width: 73vw !important;
        max-width: 370px !important;
        height: 87vw !important;
        max-height: 440px !important;
        margin: 0 !important;
        display: flex !important;
        align-items: flex-end !important;
        justify-content: center !important;
        position: relative !important;
        left: auto !important;
        transform: translateX(-30vw) translateY(-10vw) !important;
    }
    
    .player-cutout img {
        max-height: 100% !important;
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    /* Coluna Mockups (Camisas Frente/Costas) */
    .col-mockups {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        order: 2 !important;
        z-index: 2 !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end !important;
        align-items: flex-end !important;
        gap: 0 !important;
        margin: 0 !important;
        transform: translateX(16vw) !important;
        width: 100% !important;
    }
    
    .mockup-view {
        flex: 0 1 60vw !important;
        max-width: 60vw !important;
        aspect-ratio: 3/4 !important;
        margin: 0 !important;
        position: relative !important;
    }
    
    /* Sobreposição das duas camisas (Frente sobrepondo as Costas) */
    .mockup-view.front {
        margin-right: -25vw !important; /* Aumentado de -20vw para maior sobreposição */
        z-index: 4 !important; /* Fica na frente */
    }
    
    .mockup-view.back {
        z-index: 3 !important; /* Atrás da frente */
    }
    
    .mockup-view img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }
    
    /* Legenda da partida (Vem abaixo das fotos e acima das marcas) */
    .base-caption, .match-caption {
        grid-column: span 12 !important;
        order: 3 !important;
        margin: 0 auto !important;
        text-align: center !important;
        position: static !important;
        left: auto !important;
        width: 100% !important;
    }
    
    .caption-player {
        display: none !important; /* Esconde o nome duplicado no mobile conforme o mockup */
    }
    
    .caption-match {
        font-size: 0.95rem !important;
        color: #333 !important;
    }
    
    /* Coluna Marcas/Patrocínios */
    .col-assets {
        grid-column: span 12 !important;
        order: 4 !important; /* Marcas abaixo da legenda */
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .assets-cluster {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important; /* Grid de 4 colunas */
        gap: 0.8rem !important;
        justify-items: center !important;
        align-items: center !important;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }
    
    .assets-cluster > div {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        height: 45px !important; /* Altura ideal de logo para mobile */
    }
    
    .asset-icon {
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    /* Descrição base (Texto no final) */
    .base-description {
        grid-column: span 12 !important;
        order: 5 !important;
        padding: 0 !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .base-description p {
        font-size: 0.9rem !important;
        line-height: 1.6 !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        text-align: center !important;
        color: #555 !important;
    }
    
    /* Ajuste da seção de créditos no mobile */
    .credits h4,
    .sources h4,
    .credit-group-title,
    .source-group-title {
        text-align: left !important;
        margin-left: 0.5rem !important; /* Alinha visualmente com a estrela dos itens */
    }
    
    /* Melhorias do Rodapé (Footer) no Mobile */
    .main-footer {
        padding: 2rem 1rem 1.5rem 1rem !important;
    }
    
    .footer-logo {
        height: 20px !important; /* Logo bem menor */
        margin-bottom: 0.5rem !important;
    }
    
    .main-footer p {
        font-size: 0.8rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .footer-social-links {
        gap: 1.2rem !important;
    }
    
    .footer-social-links .social-icon.profile-icon {
        margin-left: 0 !important; /* Remove o distanciamento extra que ficava torto quando centralizado */
    }
    
    /* Centralizar marcações (patrocínios, aplicações, patches) quando houver apenas 1 item e manter o tamanho padrão (50% da tela) */
    .asset-grid:has(> :last-child:nth-child(1)) {
        display: flex !important;
        justify-content: center !important;
    }
    
    .asset-grid:has(> :last-child:nth-child(1)) .asset-card {
        width: 50% !important;
        flex: 0 0 50% !important;
    }
}