/* ============================================================
   VALUTA - DESIGN FINALIZADO E ORGANIZADO (V. FINAL CORRIGIDA)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Cinzel+Decorative:wght@900&family=Lora:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lora', serif;
    background-color: #ffffff;
    color: #333;
    overflow-x: hidden;
}

/* ============================================================
   CABEÇALHO (LOGO UNIFICADA - PADRONIZAÇÃO TOTAL)
   ============================================================ */
header {
    background-color: #fff;
    padding: 40px 20px 20px;
    text-align: center;
}

.logo, 
a.logo {
    display: flex;
    align-items: baseline;
    justify-content: center;
    text-decoration: none !important;
    letter-spacing: 2px;
    cursor: pointer;
    border: none;
    background: none;
}

.logo-texto, 
.logo span:not(.logo-destaque) {
    font-family: 'Cinzel', serif !important;
    font-size: 2.8rem;
    color: #1a1a1a !important;
    font-weight: 400;
    font-style: normal;
    text-transform: none;
}

.logo-destaque {
    font-family: 'Cinzel Decorative', cursive !important;
    font-size: 5.5rem;
    font-weight: 900;
    color: #ff9f00;
    text-shadow: 2px 2px 0px #000;
    line-height: 1;
    display: inline-block;
}

.subtitle {
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 8px;
    font-size: 0.75rem;
    color: #ff9f00;
    margin-top: 10px;
    font-weight: 700;
}

/* ============================================================
   NAVEGAÇÃO E BUSCA
   ============================================================ */
nav {
    background-color: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.menu-principal a {
    text-decoration: none;
    color: #333;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-right: 35px;
}

#link-carrinho {
    color: #ff9f00 !important;
}

.search-container {
    display: flex;
    align-items: center;
}

.search-container input {
    border: none;
    border-bottom: 1px solid #eee;
    background: transparent;
    outline: none;
    width: 140px;
    padding: 5px;
}

.search-icon {
    color: #ff9f00;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 8px;
}

/* ============================================================
   CONTEÚDO VITRINE (INDEX)
   ============================================================ */
.hero-intro {
    padding: 60px 20px;
    text-align: center;
}

.frase {
    font-size: 1.4rem;
    font-style: italic;
    color: #444;
    max-width: 800px;
    margin: 0 auto;
}

/* Regra para ocultar intro apenas quando o container de produto existe */
body:has(.container-produto) .hero-intro {
    display: none !important;
}

.section-header {
    text-align: center;
    margin: 50px 0 30px;
}

.section-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: #1a1a1a;
}

.livros-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 45px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.card-livro {
    width: 190px;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.card-livro img {
    width: 100%;
    height: 275px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: box-shadow 0.4s ease;
}

.card-livro:hover {
    transform: translateY(-10px);
}

.card-livro:hover img {
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.card-acoes {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.btn-detalhes {
    background-color: #ff9f00;
    color: #fff;
    border: none;
    padding: 10px 18px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.7rem;
}

.btn-carrinho-circular {
    background-color: #ff9f00;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
}

/* ============================================================
   PÁGINA DE PRODUTO (DETALHES)
   ============================================================ */
.container-produto {
    display: flex;
    gap: 80px;
    align-items: flex-start;
    max-width: 1100px;
    margin: 50px auto;
}

.produto-imagem {
    flex: 0 0 280px !important; 
}

.produto-imagem img {
    width: 280px !important; 
    height: 420px !important; 
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 15px 15px 40px rgba(0,0,0,0.12);
}

.produto-info {
    flex: 1;
}

.produto-autor {
    font-size: 1.4rem;
    color: #000 !important;
    font-style: italic;
    margin-bottom: 30px;
}

.compra-area {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-top: 80px;
}

.btn-comprar-grande {
    background-color: #ff9f00;
    color: #fff;
    border: none;
    padding: 15px 45px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 50px;
    cursor: pointer;
}

/* ============================================================
   NOVA SEÇÃO: SOBRE O AUTOR (PÁGINA DE PRODUTO)
   ============================================================ */
.secao-autor {
    max-width: 1100px;
    margin: 80px auto 40px;
    padding: 60px 20px;
    border-top: 1px solid #f0f0f0;
}

.autor-container {
    display: flex;
    align-items: center;
    gap: 50px;
    max-width: 900px;
    margin: 0 auto;
    background-color: #fafafa;
    padding: 40px;
    border-radius: 8px;
}

.autor-foto-wrapper img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ff9f00;
    filter: grayscale(100%);
    transition: all 0.4s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.autor-foto-wrapper img:hover {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.autor-detalhes h3 {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: #ff9f00;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.autor-detalhes h4 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.autor-detalhes p {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
    font-style: italic;
}

/* ============================================================
   RODAPÉ
   ============================================================ */
footer {
    background-color: #1a1a1a;
    color: #fff;
    padding: 80px 20px;
    text-align: center;
    margin-top: 100px;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
}

.footer-grid {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-item i {
    color: #ff9f00;
    font-size: 1.2rem;
}

.footer-line {
    border-top: 1px solid #333;
    margin: 20px 0;
}

.footer-bottom {
    font-size: 0.8rem;
    color: #888;
}

.dev-credito {
    margin-top: 5px;
}

/* ============================================================
   ESTILOS EXCLUSIVOS DO CARRINHO (SIDEBAR DIREITA)
   ============================================================ */

.carrinho-layout {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    gap: 60px;
}

.carrinho-banner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 5px solid #ff9f00;
    padding-left: 30px;
}

.carrinho-banner h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.carrinho-lateral {
    width: 400px;
    background-color: #fcfcfc;
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 4px;
    box-shadow: 10px 10px 30px rgba(0,0,0,0.02);
    height: fit-content;
}

.titulo-carrinho {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    margin-bottom: 25px;
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 10px;
}

#lista-itens-carrinho {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.item-carrinho {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px dotted #ccc;
    width: 100%;
}

.item-carrinho img {
    width: 70px;
    height: 100px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.item-info p {
    font-weight: bold;
    color: #ff9f00;
    font-size: 1.1rem;
}

.btn-remover {
    background: none;
    border: none;
    color: #cc0000;
    cursor: pointer;
    font-size: 0.75rem;
    text-decoration: underline;
    margin-top: 5px;
}

.carrinho-resumo {
    margin-top: 40px;
    border-top: 2px solid #eee;
    padding-top: 20px;
}

.total-container {
    display: flex;
    justify-content: space-between;
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 25px;
}

.link-voltar {
    display: block;
    text-align: center;
    margin-top: 20px;
    text-decoration: none;
    color: #666;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================================
   RESPONSIVIDADE - MOBILE (INJETADO SEM ALTERAR DESKTOP)
   ============================================================ */
@media (max-width: 768px) {
    .logo-texto { font-size: 1.8rem !important; }
    .logo-destaque { font-size: 3.5rem !important; }
    .subtitle { letter-spacing: 4px; font-size: 0.65rem; }

    .nav-links { flex-direction: column; gap: 20px; padding-bottom: 20px; }
    .menu-principal a { margin-right: 0; display: block; margin-bottom: 10px; }

    .livros-grid { gap: 20px; }
    .card-livro { width: 165px; }
    .card-livro img { height: 240px; }

    /* Correção Crítica da Página de Detalhes no Mobile */
    .container-produto { 
        flex-direction: column; 
        align-items: center; 
        gap: 30px; 
        padding: 0 20px; 
        margin-top: 30px;
        display: flex !important; /* Garante que não suma */
    }
    .produto-imagem, .produto-imagem img { 
        width: 100% !important; 
        max-width: 240px !important; 
        height: auto !important; 
    }
    .produto-info { text-align: center; width: 100%; }
    .compra-area { flex-direction: column; width: 100%; gap: 20px; margin-top: 40px; }
    .btn-comprar-grande { width: 100%; }

    .autor-container { flex-direction: column; text-align: center; gap: 25px; padding: 20px; }
    .autor-foto-wrapper img { width: 130px; height: 130px; }
    .autor-detalhes h4 { font-size: 1.5rem; }

    .footer-grid { flex-direction: column; gap: 25px; }

    /* Carrinho Mobile */
    .carrinho-layout { flex-direction: column; gap: 30px; margin: 20px auto; }
    .carrinho-banner { border-left: none; border-bottom: 4px solid #ff9f00; padding-left: 0; padding-bottom: 20px; text-align: center; }
    .carrinho-banner h2 { font-size: 1.8rem; }
    .carrinho-lateral { width: 100% !important; padding: 15px; }
}

@media (max-width: 480px) {
    .card-livro { width: 100%; max-width: 200px; }
    .logo-destaque { font-size: 2.8rem !important; }
    .logo-texto { font-size: 1.5rem !important; }
}