/* Definição de Variáveis e Estilos Globais */
:root {
    --color-background: #121212; /* Preto (Material Design dark) */
    --color-surface: #1e1e1e;   /* Cinza escuro para cards */
    --color-primary: #7D40E7;   /* Roxo vibrante do logo */
    --color-text: #FFFFFF;       /* Texto principal (branco) */
    --color-text-muted: #a0a0a0; /* Texto secundário (cinza) */
    --font-family: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: #000000; /* Header preto sólido */
    border-bottom: 1px solid #333;
}

.logo a {
    text-decoration: none;
    color: var(--color-text);
    font-size: 1.8rem;
    font-weight: 800; /* Mais pesado para combinar com o logo */
    letter-spacing: -1px;
}

/* Estilização para o 'HUB' no logo */
.logo a span {
    background-color: var(--color-primary);
    color: var(--color-text);
    padding: 0.1rem 0.6rem;
    margin-left: 0.1rem;
    border-radius: 4px;
    font-weight: 700;
}


.main-nav a {
    margin: 0 1rem;
    text-decoration: none;
    color: var(--color-text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: var(--color-primary);
}

.header-actions {
    display: flex;
    align-items: center;
}

.search-bar {
    background-color: var(--color-surface);
    border: 1px solid #333;
    border-radius: 5px;
    padding: 0.5rem;
    color: var(--color-text);
    margin-right: 1rem;
}

.action-icon {
    font-size: 1.5rem;
    margin-left: 1rem;
    text-decoration: none;
    color: var(--color-text-muted);
}

/* Seção Hero (Destaque) */
.hero-section {
    /* Sugestão: Usar um fundo mais abstrato/moderno que combina com a nova identidade */
    background: linear-gradient(rgba(18, 18, 18, 0.8), rgba(18, 18, 18, 1)), url('https://www.thewitcher.com/_next/image?url=https%3A%2F%2Fstatic.cdprojektred.com%2Fcms.cdprojektred.com%2F16x9_big%2Ffcaa0ba91e2368e2aef8c0d556692307768fad49-1920x1080.jpg&w=1920&q=75') no-repeat center center/cover;
    padding: 4rem 5%;
    text-align: left;
}

.hero-content {
    max-width: 600px;
}

.hero-tag {
    background-color: var(--color-primary);
    color: var(--color-text);
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin: 1rem 0;
}

.price-section {
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
}

.current-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.original-price {
    text-decoration: line-through;
    color: var(--color-text-muted);
    margin: 0 1rem;
}

.discount-badge {
    background-color: #34d399; /* Verde continua bom para descontos */
    color: #121212;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-weight: 600;
}

/* Botões */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px; /* Bordas um pouco mais retas */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    /* Efeito de brilho com a cor primária */
    box-shadow: 0 0 15px 0 rgba(125, 64, 231, 0.5); 
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    margin-right: 1rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    width: 100%;
}


/* Seção de Jogos */
.games-section {
    padding: 2rem 5%;
}

.games-header {
    margin-bottom: 2rem;
}

.filter-tags {
    margin-top: 1rem;
}

.filter-btn {
    background-color: var(--color-surface);
    color: var(--color-text-muted);
    border: 1px solid #333;
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-btn.active, .filter-btn:hover {
    background-color: var(--color-primary);
    color: var(--color-text);
    border-color: var(--color-primary);
    font-weight: 600;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background-color: var(--color-surface);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid transparent;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.game-card img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
}

.game-card-info {
    padding: 1rem;
}

.game-card-info h3 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.game-price {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 2rem 5%;
    margin-top: 2rem;
    border-top: 1px solid #333;
    color: var(--color-text-muted);
}

/* Estilos do Carrinho de Compras */
.cart-icon {
    position: relative; /* Necessário para posicionar o contador */
}

.cart-item-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--color-primary);
    color: var(--color-text);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    border: 2px solid var(--color-background);
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Começa fora da tela */
    width: 400px;
    height: 100%;
    background-color: var(--color-surface);
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    transition: right 0.4s ease-in-out;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0; /* Move para dentro da tela */
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #333;
}

.close-cart-btn {
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 2rem;
    cursor: pointer;
}

.cart-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Estilo para quando o carrinho está vazio */
.cart-body.empty {
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-text-muted);
}

.cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.cart-item img {
    width: 100px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 1rem;
}

.cart-item-info {
    flex-grow: 1;
}
.cart-item-info h4 {
    font-size: 0.9rem;
    margin: 0;
}
.cart-item-info p {
    color: var(--color-primary);
    font-weight: 600;
    margin: 0;
}

.remove-item-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.8rem;
}
.remove-item-btn:hover {
    color: #ef4444; /* Vermelho para ação de remover */
}

.cart-footer {
    padding: 1rem;
    border-top: 1px solid #333;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.checkout-btn {
    width: 100%;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
}

.cart-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Responsividade */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav {
        margin-top: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .hero-section {
        text-align: center;
    }
    
    .hero-content {
        max-width: 100%;
    }

    .hero-buttons, .price-section {
        justify-content: center;
    }
}