/* =========================================
   1. Importação de Fontes (Playfair Display)
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Roboto:wght@300;400;600&display=swap');

/* =========================================
   2. Container e Grid de Livros
   ========================================= */
.wplp-livros-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    padding: 20px 0;
}

/* Card do Livro */
.wplp-livro-card {
    background: #111; /* Fundo escuro como no seu código anterior */
    border: 1px solid #333; /* Borda sutil para separar do fundo */
    border-radius: 15px;
    padding: 20px;
    width: 280px; /* Largura padrão Desktop */
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.wplp-livro-card:hover {
    transform: translateY(-5px);
    border-color: #555;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

/* Capa do Livro */
.wplp-livro-capa img {
    width: 100%;
    height: auto;
    border-radius: 15px; /* Borda arredondada solicitada */
    object-fit: cover;
    margin-bottom: 15px;
    border: none; /* Removi a borda branca simples para ficar mais clean */
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

/* Título do Livro - Fonte Bonita e Clara */
.wplp-livro-titulo {
    font-family: 'Playfair Display', serif; /* Fonte elegante */
    font-size: 1.5em;
    color: #ffffff; /* Cor Branca para contraste com fundo escuro */
    margin-top: 5px;
    margin-bottom: 20px;
    line-height: 1.3;
    font-weight: 400;
}

/* =========================================
   3. Botões (Comprar e Saiba Mais)
   ========================================= */
.wplp-livro-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.wplp-btn {
    flex-grow: 1;
    padding: 12px 10px;
    border: none;
    border-radius: 30px; /* Botões bem arredondados */
    cursor: pointer;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.9em;
    text-transform: uppercase;
}

.wplp-btn:active {
    transform: scale(0.98);
}

/* Botão Saiba Mais (Outline/Contorno) */
.wplp-btn-detalhes {
    background-color: transparent;
    border: 1px solid #fff;
    color: #fff;
}

.wplp-btn-detalhes:hover {
    background-color: #fff;
    color: #000;
}

/* Botão Comprar (Dourado/Amarelo para destaque ou Verde) */
.wplp-btn-comprar {
    background-color: #d4af37; /* Dourado combinando com 'Bem Estar' */
    color: #000;
}

.wplp-btn-comprar:hover {
    background-color: #f1c40f;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.4);
}

/* =========================================
   4. RESPONSIVIDADE (MOBILE AJUSTADO)
   ========================================= */
@media (max-width: 600px) {
    .wplp-livros-container {
        padding: 0 15px; /* Remove espaços enormes, deixa só margem de segurança */
        gap: 20px;
    }

    .wplp-livro-card {
        width: 100%; /* Ocupa toda a largura disponível */
        max-width: none; /* Remove limitação de tamanho */
        margin-bottom: 10px;
        padding: 20px;
    }

    .wplp-livro-titulo {
        font-size: 1.6em; /* Título um pouco maior no celular para leitura */
    }
    
    .wplp-livro-actions {
        flex-direction: row; /* Mantém botões lado a lado */
    }
}
/* =========================================
   5. Shadow Box (Modal) - CORRIGIDO (Scroll)
   ========================================= */
.wplp-shadow-box {
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Fundo escuro levemente transparente */
    display: flex;
    justify-content: center;
    align-items: center; /* Centraliza verticalmente */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px; /* Garante que não encoste nas bordas em telas pequenas */
    box-sizing: border-box;
}

.wplp-shadow-box:not(.wplp-hidden) {
    opacity: 1;
    visibility: visible;
}

.wplp-modal-conteudo {
    background-color: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    /* --- O SEGREDO DO SCROLL ESTÁ AQUI --- */
    max-height: 90vh; /* Altura máxima de 90% da tela */
    overflow-y: auto; /* Cria barra de rolagem se o conteúdo for maior */
    /* ------------------------------------- */
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    padding: 30px;
    box-sizing: border-box;
}

/* Estilizando a barra de rolagem para ficar bonita (Webkit) */
.wplp-modal-conteudo::-webkit-scrollbar {
    width: 8px;
}
.wplp-modal-conteudo::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.wplp-modal-conteudo::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.wplp-modal-conteudo::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.wplp-modal-grid {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.wplp-modal-capa {
    flex: 0 0 35%; /* Coluna da capa fixa em 35% */
    text-align: center;
    position: sticky; /* Faz a capa acompanhar o scroll se o texto for muito longo */
    top: 0;
}

.wplp-modal-capa img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.wplp-modal-info {
    flex: 1;
}

.wplp-modal-info h2 {
    font-family: 'Playfair Display', serif;
    color: #111;
    margin-top: 0;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 2em;
    line-height: 1.2;
}

.wplp-modal-descricao {
    line-height: 1.8; /* Aumentei o espaçamento entre linhas para facilitar a leitura */
    color: #444;
    font-size: 1.05em;
    text-align: justify; /* Opcional: deixa o texto alinhado, fica mais organizado */
}

/* Espaçamento entre parágrafos no texto */
.wplp-modal-descricao p {
    margin-bottom: 15px;
}

/* Botão Fechar (X) - Fixo no topo durante o scroll */
.wplp-fechar-modal {
    position: sticky; /* O segredo: gruda no topo ao rolar */
    top: 10px;        /* Distância do topo da caixa */
    float: right;     /* Garante que fique no canto direito */
    z-index: 1000;    /* Garante que fique acima da capa e texto */
    
    /* Ajuste visual para não empurrar o conteúdo */
    margin-bottom: -40px; 
    
    /* Estilo do Botão */
    color: #888;
    background: #fff; /* Fundo branco para garantir leitura sobre imagens */
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Sombra para destacar */
    transition: all 0.2s;
}

.wplp-fechar-modal:hover {
    color: #000;
    background: #f0f0f0;
    transform: scale(1.1); /* Pequeno zoom ao passar o mouse */
}

/* Responsividade do Modal */
@media (max-width: 768px) {
    .wplp-modal-grid {
        flex-direction: column;
        align-items: center;
    }
    
    .wplp-modal-capa {
        flex: 0 0 auto;
        width: 100%;
        max-width: 200px;
        margin-bottom: 20px;
        position: static; /* Remove o sticky no mobile */
    }

    .wplp-modal-conteudo {
        padding: 20px;
        max-height: 85vh; /* Um pouco menor no mobile para caber o X de fechar do navegador */
    }

    .wplp-modal-info h2 {
        font-size: 1.5em;
        text-align: center;
    }
}

/* =========================================
   6. Página Individual (Single)
   ========================================= */
/* Mantendo o estilo da página individual que já configuramos */
.wplp-single-main {
    padding: 60px 20px;
    background-color: #f4f4f4;
    min-height: 80vh;
}

.wplp-livro-full {
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.wplp-single-titulo {
    font-family: 'Playfair Display', serif;
    font-size: 2.5em;
    color: #333;
    margin-bottom: 20px;
}

.wplp-single-body {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
}

.wplp-single-media {
    flex: 0 0 300px;
    max-width: 100%;
}

.wplp-single-capa {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.wplp-single-description {
    flex: 1;
    font-size: 1.1em;
    color: #555;
    line-height: 1.8;
}

@media (max-width: 768px) {
    .wplp-single-body {
        flex-direction: column;
    }
    .wplp-single-media {
        flex: 0 0 auto;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}