/* =========================================================
   ENTRE BUGS E SOLUÇÕES
   CSS - Página Inicial
   ========================================================= */

/* ---------- Reset ---------- */

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


/* ---------- Variáveis ---------- */

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #111827;
    --text-secondary: #6b7280;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;

    --success: #16a34a;

    --border: #e5e7eb;

    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 18px 40px rgba(0, 0, 0, 0.13);

    --radius: 16px;
}


/* ---------- Body ---------- */

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: var(--bg);
    color: var(--text);

    line-height: 1.6;
}


/* ---------- Links ---------- */

a {
    color: inherit;
    text-decoration: none;
}


/* =========================================================
   HEADER
   ========================================================= */

header {
    background:
        linear-gradient(
            135deg,
            #111827 0%,
            #1e293b 100%
        );

    color: #ffffff;

    padding: 70px 20px;

    text-align: center;
}


.header-content {
    width: min(1100px, 92%);
    margin: 0 auto;
}


header h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);

    font-weight: 800;

    letter-spacing: -1px;

    margin-bottom: 12px;
}


header p {
    max-width: 650px;

    margin: 0 auto;

    color: #d1d5db;

    font-size: 1.1rem;
}


/* =========================================================
   CONTAINER
   ========================================================= */

.container {
    width: min(1100px, 92%);

    margin: 0 auto;

    padding: 65px 0;
}


/* =========================================================
   TÍTULO DA SEÇÃO
   ========================================================= */

.section-title {
    text-align: center;

    margin-bottom: 40px;
}


.section-title h2 {
    font-size: clamp(1.7rem, 4vw, 2.3rem);

    font-weight: 750;

    letter-spacing: -0.5px;

    margin-bottom: 8px;
}


.section-title p {
    color: var(--text-secondary);

    font-size: 1rem;
}


/* =========================================================
   GRID DOS EBOOKS
   ========================================================= */

.ebooks {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(280px, 1fr)
        );

    gap: 30px;

    align-items: stretch;
}


/* =========================================================
   CARD
   ========================================================= */

.card {
    position: relative;

    display: flex;

    flex-direction: column;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    overflow: hidden;

    box-shadow: var(--shadow);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}


.card:hover {
    transform: translateY(-6px);

    box-shadow: var(--shadow-hover);
}


/* =========================================================
   IMAGEM / CAPA
   ========================================================= */

/*
   A capa é vertical.

   A altura fixa evita que ela fique exageradamente grande,
   enquanto o object-fit: contain garante que a capa inteira
   fique visível sem cortes.
*/

.card-image {
    display: block;

    width: 100%;

    height: 380px;

    object-fit: contain;

    background: #eef1f5;
}


/* =========================================================
   CONTEÚDO DO CARD
   ========================================================= */

.card-content {
    display: flex;

    flex-direction: column;

    flex: 1;

    padding: 25px;
}


.card-content h3 {
    font-size: 1.3rem;

    line-height: 1.35;

    font-weight: 750;

    margin-bottom: 12px;
}


.card-content p {
    color: var(--text-secondary);

    font-size: 0.96rem;

    line-height: 1.65;

    margin-bottom: 20px;
}


/* =========================================================
   PREÇO
   ========================================================= */

.price {
    margin-top: auto;

    margin-bottom: 20px;
}


.old-price {
    display: block;

    color: #9ca3af;

    font-size: 0.95rem;

    text-decoration: line-through;

    margin-bottom: 2px;
}


.current-price {
    display: block;

    color: var(--success);

    font-size: 1.65rem;

    font-weight: 800;

    line-height: 1.2;
}


/* =========================================================
   BOTÃO
   ========================================================= */

.button {
    display: flex;

    align-items: center;

    justify-content: center;

    width: 100%;

    min-height: 48px;

    padding: 12px 20px;

    background: var(--primary);

    color: #ffffff;

    border-radius: 9px;

    font-size: 1rem;

    font-weight: 700;

    text-align: center;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.button:hover {
    background: var(--primary-hover);

    transform: translateY(-1px);
}


.button:active {
    transform: translateY(0);
}


/* =========================================================
   SELO DE DESCONTO
   ========================================================= */

.discount-badge {
    position: absolute;

    top: 15px;

    right: 15px;

    z-index: 2;

    padding: 6px 10px;

    background: var(--success);

    color: #ffffff;

    border-radius: 999px;

    font-size: 0.8rem;

    font-weight: 800;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15);
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
    background: #111827;

    color: #9ca3af;

    text-align: center;

    padding: 35px 20px;

    margin-top: 20px;
}


footer p {
    font-size: 0.9rem;
}


/* =========================================================
   TABLETS
   ========================================================= */

@media (max-width: 768px) {

    header {
        padding: 55px 20px;
    }


    .container {
        width: 92%;

        padding: 45px 0;
    }


    .ebooks {
        grid-template-columns: 1fr;

        max-width: 430px;

        margin: 0 auto;

        gap: 24px;
    }


    .card-image {
        height: 350px;
    }
}


/* =========================================================
   CELULARES PEQUENOS
   ========================================================= */

@media (max-width: 400px) {

    header {
        padding: 45px 16px;
    }


    header h1 {
        font-size: 1.9rem;
    }


    header p {
        font-size: 0.95rem;
    }


    .container {
        width: 90%;

        padding: 40px 0;
    }


    .section-title {
        margin-bottom: 30px;
    }


    .card-image {
        height: 320px;
    }


    .card-content {
        padding: 20px;
    }


    .card-content h3 {
        font-size: 1.15rem;
    }


    .card-content p {
        font-size: 0.92rem;
    }


    .current-price {
        font-size: 1.5rem;
    }


    .discount-badge {
        top: 10px;

        right: 10px;

        font-size: 0.75rem;
    }
}