/*
========================================
GAMING PACKS V2 - CSS REFAITO DO ZERO
A Casa dos Gamers - Design Mantido, Funcionalidade Nova
========================================
*/

/* ========================================
   RESET E BASE
======================================== */

/* Contenção de layout para evitar shifts */
.acg-packs-v2-container {
    contain: layout style;
}
.acg-packs-v2-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    overflow: hidden;
}

.acg-packs-v2-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========================================
   HEADER
======================================== */
.packs-v2-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    gap: 20px;
}

.packs-v2-title-area {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.packs-v2-titulo {
    font-family: 'Rubik', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #000000;
    line-height: 1.3;
    margin: 0;
    text-shadow: none;
}

.packs-v2-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-personalizar-v2,
.btn-todos-packs-v2 {
    background: transparent;
    border: 2px solid #ff8301;
    color: #ff8301;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Rubik', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-personalizar-v2:hover,
.btn-todos-packs-v2:hover {
    background: #ff8301;
    color: #00080f;
}

.btn-todos-packs-v2 {
    border-color: #28a745;
    color: #28a745;
}

.btn-todos-packs-v2:hover {
    background: #28a745;
    color: white;
}

.btn-desconto-info {
    background: transparent;
    border: 2px solid #8b5cf6;
    color: #8b5cf6;
    padding: 6px 12px;
    border-radius: 20px;
    font-family: 'Rubik', sans-serif;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-desconto-info:hover {
    background: #8b5cf6;
    color: white;
    transform: translateY(-1px);
}

/* ========================================
   GRID LAYOUT
======================================== */
.packs-v2-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 400px;
}

/* ========================================
   PACK DESTACADO (50% ESQUERDA)
======================================== */
.pack-v2-destacado {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: #000000;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-end;
}

.pack-v2-destacado:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.pack-v2-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.5s ease;
}

.pack-v2-destacado:hover .pack-v2-bg,
.mini-pack-v2:hover .pack-v2-bg {
    transform: scale(1.1);
}

.pack-v2-desconto {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #00ff88;
    color: #00080f;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    z-index: 2;
    min-width: 50px;
    text-align: center;
}

.pack-v2-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    color: #ffffff;
    width: 100%;
    background: linear-gradient(to bottom, transparent 30%, rgba(0, 0, 0, 0.8));
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* MUDANÇA: espaçamento uniforme */
    min-height: 240px; /* MUDANÇA: altura mínima maior para consistência */
    align-items: flex-start;
    padding-bottom: 40px;
    padding-top: 60px;
}

.pack-v2-nome {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    color: #ffffff;
    line-height: 1.2;
    /* NOVO: Limitar altura e adicionar ellipsis para textos longos */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Máximo 2 linhas */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.4em; /* Altura fixa para 2 linhas */
}

.pack-v2-desc {
    font-size: 17px; /* AUMENTADO MAIS: 16px → 17px */
    color: #ffffff; /* NOVO: Branco puro para melhor contraste */
    opacity: 1; /* MUDANÇA: Sem opacidade para cor mais forte */
    margin-bottom: 10px; /* DIMINUÍDO MAIS: 15px → 10px (sobe mais) */
    line-height: 1.5;
    /* CONTORNO PRETO FORTE (stroke/delineado) + sombras */
    text-shadow:
        -1px -1px 0 #000000,  /* Contorno superior esquerdo */
        1px -1px 0 #000000,   /* Contorno superior direito */
        -1px 1px 0 #000000,   /* Contorno inferior esquerdo */
        1px 1px 0 #000000,    /* Contorno inferior direito */
        0 3px 6px rgba(0,0,0,0.9), /* Sombra difusa */
        0 1px 2px rgba(0,0,0,1);   /* Sombra nítida */
    font-weight: 700; /* MAIS PESADO: 600 → 700 */
}

.pack-v2-preco {
    font-size: 32px;
    font-weight: 700;
    color: #00ff88;
    margin-bottom: 24px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    letter-spacing: -0.5px;
    margin-top: auto; /* NOVO: Empurra preço para baixo */
}

/* ========================================
   MINI PACKS (50% DIREITA)
======================================== */
.mini-packs-v2-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.mini-pack-v2 {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000000;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-end;
    min-height: 185px;
}

.mini-pack-v2:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.mini-pack-v2 .pack-v2-content {
    padding: 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* MUDANÇA: espaçamento uniforme */
    height: 100%;
    min-height: 185px; /* NOVO: altura mínima consistente */
    position: relative;
    align-items: flex-start;
}

.mini-pack-v2 .pack-v2-nome {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #ffffff;
    line-height: 1.3;
    /* NOVO: Limitar altura e adicionar ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6em; /* Altura fixa para 2 linhas */
    margin-right: 55px;
}

.mini-pack-v2 .pack-v2-desc {
    font-size: 14px; /* AUMENTADO MUITO MAIS: 13px → 14px */
    color: #ffffff; /* NOVO: Branco puro para melhor contraste */
    margin-bottom: 4px; /* DIMINUÍDO MAIS: 6px → 4px (sobe mais) */
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    opacity: 1; /* MUDANÇA: Sem opacidade para cor mais forte */
    margin-right: 55px;
    word-wrap: break-word;
    /* CONTORNO PRETO FORTE (stroke/delineado) + sombras */
    text-shadow:
        -1px -1px 0 #000000,  /* Contorno superior esquerdo */
        1px -1px 0 #000000,   /* Contorno superior direito */
        -1px 1px 0 #000000,   /* Contorno inferior esquerdo */
        1px 1px 0 #000000,    /* Contorno inferior direito */
        0 3px 6px rgba(0,0,0,0.9), /* Sombra difusa */
        0 1px 2px rgba(0,0,0,1);   /* Sombra nítida */
    font-weight: 700; /* MUITO MAIS PESADO: 600 → 700 */
}

.mini-pack-v2 .pack-v2-preco {
    font-size: 18px;
    margin-bottom: 12px;
    margin-top: auto;
}

.mini-pack-v2 .pack-v2-desconto {
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 11px;
    min-width: 45px;
    z-index: 3;
}


/* ========================================
   WRAPPER PARA PREÇO E BOTÃO (NOVO)
======================================== */
.pack-v2-bottom {
    margin-top: auto; /* Empurra para o fundo */
    width: 100%;
}

/* ========================================
   BOTÕES DOS PACKS
======================================== */
.btn-pack-v2 {
    background: #ff8301;
    color: #ffffff;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Rubik', sans-serif;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 80px;
    text-align: center;
    vertical-align: middle;
    line-height: 1.2;
}

.btn-pack-v2:hover {
    background: #ff9a2b;
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-pack-v2:active {
    transform: translateY(0);
}

.btn-pack-v2.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-pack-v2.pack-adicionado {
    background: #28a745;
    color: #ffffff;
}

.btn-pack-v2.pack-adicionado:hover {
    background: #218838;
}

.btn-pack-v2.mini {
    padding: 4px 8px !important;
    font-size: 10px !important;
    min-width: auto !important;
    height: auto !important;
    line-height: 1.2 !important;
}

.btn-pack-v2 i {
    font-size: 14px;
}

.btn-pack-v2.mini i {
    font-size: 10px !important;
}

/* FIX FORÇADO - BOTÕES TAMANHO DESCENTE */
.pack-v2-destacado .btn-pack-v2,
.mini-pack-v2 .btn-pack-v2,
.acg-packs-v2-container .btn-pack-v2 {
    padding: 10px 14px !important;
    font-size: 13px !important;
    min-width: 100px !important;
    width: auto !important;
    height: auto !important;
    line-height: 1.2 !important;
    max-width: 150px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    vertical-align: middle !important;
}

/* ========================================
   TOAST DE FEEDBACK
======================================== */
.pack-v2-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 999999;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    cursor: pointer;
    max-width: 300px;
}

.pack-v2-toast.show {
    transform: translateX(0);
}

.pack-v2-toast.toast-error {
    background: #dc3545;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-content i {
    font-size: 18px;
}

.toast-message {
    font-weight: 500;
    line-height: 1.4;
}

/* ========================================
   ANIMAÇÕES
======================================== */
/* Animação pulse removida - causava efeito "piscando" indesejado */

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

/* Tablet */
@media (max-width: 1024px) {
    .packs-v2-grid {
        gap: 15px;
        height: 350px;
    }

    .packs-v2-titulo {
        font-size: 22px;
    }

    .pack-v2-nome {
        font-size: 20px;
    }

    .pack-v2-preco {
        font-size: 24px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .acg-packs-v2-container {
        padding: 20px 10px;
    }

    .packs-v2-header {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-bottom: 20px;
    }

    /* MANTER TÍTULO E BADGE NA MESMA LINHA NO MOBILE */
    .packs-v2-title-area {
        justify-content: center;
        align-items: baseline;
        gap: 8px;
        flex-direction: row !important;
        flex-wrap: nowrap;
        margin-bottom: 10px;
    }

    .packs-v2-titulo {
        font-size: 18px;
        text-align: center;
        white-space: nowrap;
    }

    /* BOTÕES MOBILE COM TAMANHO CONSISTENTE E UNIFORME */
    .packs-v2-buttons {
        justify-content: center;
        gap: 10px;
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        max-width: 350px;
    }

    .btn-personalizar-v2,
    .btn-todos-packs-v2,
    .btn-desconto-info {
        min-width: 110px;
        height: 38px;
        font-size: 11px;
        padding: 8px 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        flex: 1;
        max-width: 140px;
        border-radius: 8px;
        font-weight: 600;
    }

    .btn-desconto-info {
        flex-basis: 100%;
        max-width: 200px;
        margin-top: 5px;
        font-size: 10px;
        height: 34px;
        border-radius: 20px;
    }

    .packs-v2-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        height: auto;
    }

    .pack-v2-destacado {
        height: 220px; /* AUMENTADO: 200px → 220px para mais espaço */
        min-height: 220px;
    }

    .pack-v2-destacado .pack-v2-content {
        padding: 20px;
        min-height: 160px; /* AUMENTADO: 140px → 160px */
        padding-top: 40px; /* DIMINUÍDO: 50px → 40px para dar mais espaço ao título */
        justify-content: space-between; /* MUDANÇA: Manter alinhamento consistente */
        display: flex;
        flex-direction: column;
    }

    .pack-v2-destacado .pack-v2-nome {
        font-size: 1.4rem;
        margin-bottom: 8px;
        /* CORREÇÃO MOBILE REFORÇADA: Garantir que o título apareça */
        min-height: auto !important;
        max-height: none !important;
        -webkit-line-clamp: unset !important;
        overflow: visible !important;
        z-index: 10;
        position: relative;
    }

    .pack-v2-destacado .pack-v2-desc {
        font-size: 13px;
        margin-bottom: 12px;
        /* SOLUÇÃO ELLIPSIS: Limitar texto para não empurrar título */
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Máximo 2 linhas */
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-height: 2.6em; /* Altura fixa para 2 linhas */
    }

    .pack-v2-destacado .pack-v2-preco {
        font-size: 24px;
        margin-bottom: 16px;
    }

    .mini-packs-v2-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        height: auto;
    }

    .mini-pack-v2 {
        height: 160px;
        min-height: 160px;
    }

    .mini-pack-v2 .pack-v2-content {
        padding: 8px 12px; /* MUDOU: Menos padding vertical (12px → 8px) */
        justify-content: flex-start; /* MUDOU: Começar do topo para subir conteúdo */
        min-height: 130px;
        display: flex;
        flex-direction: column;
        padding-top: 15px; /* NOVO: Forçar começo mais no topo */
    }

    .mini-pack-v2 .pack-v2-nome {
        font-size: 0.9rem;
        margin-bottom: 2px; /* DIMINUÍDO: 4px → 2px */
        line-height: 1.2;
        max-height: 2.4em;
        overflow: hidden;
        margin-right: 45px;
        word-wrap: break-word;
        margin-top: 0; /* NOVO: Garantir que não tenha margem superior */
    }

    .mini-pack-v2 .pack-v2-desc {
        font-size: 10px;
        margin-bottom: 6px;
        line-height: 1.2;
        max-height: 2.4em;
        overflow: hidden;
        margin-right: 45px;
        word-wrap: break-word;
    }

    .mini-pack-v2 .pack-v2-preco {
        font-size: 16px;
        margin-bottom: 8px;
        margin-top: auto;
    }

    .mini-pack-v2 .btn-pack-v2 {
        padding: 4px 8px !important; /* AUMENTADO: Mais padding */
        font-size: 10px !important; /* AUMENTADO: 9px → 10px */
        margin-top: auto !important; /* NOVO: Empurra botão para baixo */
        min-width: 70px !important; /* AUMENTADO: 60px → 70px */
        height: 24px !important; /* AUMENTADO: 20px → 24px */
        border-radius: 5px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1.2 !important; /* MELHORADO: 1 → 1.2 */
        text-align: center !important; /* NOVO: Centralizar texto */
        font-weight: 600 !important; /* NOVO: Fonte mais pesada */
        letter-spacing: 0.2px !important; /* NOVO: Espaçamento das letras */
    }

    .mini-pack-v2 .pack-v2-desconto {
        top: 6px;
        right: 6px;
        padding: 2px 6px;
        font-size: 10px;
        min-width: 35px;
        z-index: 3;
    }

    .pack-v2-toast {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }

    .pack-v2-toast.show {
        transform: translateY(0);
    }
}

/* Mobile Pequeno */
@media (max-width: 480px) {
    .acg-packs-v2-container {
        padding: 15px 8px;
    }

    /* MANTER TÍTULO E BADGE JUNTOS NO MOBILE PEQUENO */
    .packs-v2-title-area {
        flex-direction: row !important;
        gap: 6px;
        text-align: center;
        justify-content: center;
        align-items: baseline;
        flex-wrap: nowrap;
    }

    .packs-v2-titulo {
        font-size: 16px;
        white-space: nowrap;
    }

    /* BOTÕES EM GRID PARA MOBILE PEQUENO */
    .packs-v2-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
        max-width: 300px;
    }

    .btn-personalizar-v2,
    .btn-todos-packs-v2 {
        min-width: unset;
        max-width: unset;
        width: 100%;
        height: 36px;
        font-size: 10px;
        padding: 6px 8px;
    }

    .btn-desconto-info {
        grid-column: 1 / -1;
        justify-self: center;
        max-width: 180px;
        height: 32px;
        font-size: 9px;
        margin-top: 4px;
    }

    .pack-v2-destacado {
        height: 180px;
        min-height: 180px;
    }

    .pack-v2-destacado .pack-v2-content {
        padding: 16px;
        min-height: 120px;
        padding-top: 40px;
        justify-content: center;
    }

    .pack-v2-destacado .pack-v2-nome {
        font-size: 1.2rem;
    }

    .pack-v2-destacado .pack-v2-preco {
        font-size: 20px;
    }

    .mini-packs-v2-container {
        gap: 8px;
    }

    .mini-pack-v2 {
        height: 140px;
        min-height: 140px;
    }

    .mini-pack-v2 .pack-v2-content {
        padding: 10px;
        min-height: 110px;
        justify-content: flex-end;
    }

    .mini-pack-v2 .pack-v2-nome {
        font-size: 0.8rem;
        line-height: 1.2;
        margin-bottom: 3px;
        max-height: 2.4em;
        overflow: hidden;
        margin-right: 35px;
        word-wrap: break-word;
    }

    .mini-pack-v2 .pack-v2-desc {
        font-size: 9px;
        line-height: 1.2;
        margin-bottom: 4px;
        max-height: 2.4em;
        overflow: hidden;
        margin-right: 35px;
        word-wrap: break-word;
    }

    .mini-pack-v2 .pack-v2-preco {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .mini-pack-v2 .btn-pack-v2 {
        padding: 2px 5px !important;
        font-size: 8px !important;
        height: 18px !important;
        min-width: 55px !important;
        border-radius: 3px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important;
    }

    .mini-pack-v2 .pack-v2-desconto {
        top: 4px;
        right: 4px;
        padding: 1px 4px;
        font-size: 9px;
        min-width: 30px;
        z-index: 3;
    }
}

/* ========================================
   DEBUG - REMOVER EM PRODUÇÃO
======================================== */
.btn-pack-v2[data-produtos=""],
.btn-pack-v2:not([data-produtos]) {
    border: 2px dashed #dc3545 !important;
    background: rgba(220, 53, 69, 0.1) !important;
    position: relative;
}

.btn-pack-v2[data-produtos=""]:before,
.btn-pack-v2:not([data-produtos]):before {
    content: "⚠️ SEM PRODUTOS";
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    font-size: 10px;
    border-radius: 4px;
    z-index: 10;
    white-space: nowrap;
}

/* ========================================
   MELHORIAS DE PERFORMANCE
======================================== */
.pack-v2-bg {
    will-change: transform;
    transform: translateZ(0); /* Hardware acceleration */
}

.btn-pack-v2 {
    will-change: transform;
    backface-visibility: hidden; /* Anti-aliasing */
}

.pack-v2-destacado,
.mini-pack-v2 {
    will-change: box-shadow;
}

/* Hover otimizado sem movimento das divs */
@media (hover: hover) {
    .pack-v2-destacado:hover,
    .mini-pack-v2:hover {
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
    }
}

/* Lazy loading para backgrounds */
.pack-v2-bg {
    background-attachment: scroll; /* Melhor performance que fixed */
}

/* GPU acceleration apenas para elementos que precisam */
.btn-pack-v2 {
    transform: translate3d(0, 0, 0);
}

/* ========================================
   ACESSIBILIDADE E SEO
======================================== */
.btn-pack-v2:focus,
.btn-personalizar-v2:focus,
.btn-todos-packs-v2:focus,
.btn-desconto-info:focus {
    outline: 2px solid #ff8301;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(255, 131, 1, 0.3);
}

/* Melhor contraste para texto */
.pack-v2-nome {
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.pack-v2-desc {
    color: #f5f5f5;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
}

/* Skip links para navegação por teclado */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 8px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: #000;
    color: #fff;
    z-index: 999999;
}

@media (prefers-reduced-motion: reduce) {
    .pack-v2-destacado,
    .mini-pack-v2,
    .btn-pack-v2,
    .btn-personalizar-v2,
    .btn-todos-packs-v2 {
        transition: none !important;
        transform: none !important;
        animation: none !important;
    }

    .btn-pack-v2:hover {
        animation: none;
        transform: none;
    }
}

/* Prefers contrast */
@media (prefers-contrast: high) {
    .pack-v2-destacado,
    .mini-pack-v2 {
        border: 2px solid #fff;
    }

    .btn-pack-v2,
    .btn-personalizar-v2,
    .btn-todos-packs-v2 {
        border-width: 3px;
    }
}