/* =====================================================================
   BIBLIOTECA DE E-BOOKS — /ebooks
   ===================================================================== */

/* ====================== HERO ====================== */
.eb-hero {
    position: relative;
    overflow: hidden;
    padding: 64px 0 48px;
    background: linear-gradient(160deg, #070821 0%, #1b1355 40%, #2d1470 70%, #3b1a8e 100%);
}

.eb-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 15% 30%, rgba(122, 40, 255, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 500px 350px at 85% 60%, rgba(91, 30, 187, 0.14) 0%, transparent 70%);
    pointer-events: none;
}

.eb-hero .container {
    position: relative;
    z-index: 2;
}

.eb-hero-row {
    display: flex;
    align-items: center;
    gap: 40px;
}

.eb-hero-text {
    flex: 1;
    min-width: 0;
}

.eb-hero-img {
    flex: 0 0 500px;
    max-width: 500px;
    margin: -40px 0;
}

.eb-hero-img img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.35));
}

.eb-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(122, 40, 255, 0.2);
    border: 1px solid rgba(122, 40, 255, 0.35);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #c4b5fd;
    margin-bottom: 16px;
    backdrop-filter: blur(4px);
}

.eb-hero h1 {
    color: #fff;
    font-size: clamp(26px, 3.5vw, 42px);
    font-weight: 800;
    line-height: 1.18;
    margin: 0 0 14px;
}

.eb-hero h1 span {
    background: linear-gradient(90deg, #a78bfa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.eb-hero-desc {
    color: #d4c6f0;
    font-size: clamp(14px, 1.5vw, 17px);
    line-height: 1.6;
    margin: 0 0 28px;
    max-width: 700px;
}

.eb-hero-stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.eb-hero-stat {
    text-align: center;
}

.eb-hero-stat-num {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.eb-hero-stat-label {
    font-size: 13px;
    color: #b8a4d6;
    font-weight: 500;
}

/* ====================== BUSCA ====================== */
.eb-busca {
    padding: 0;
    margin-top: -24px;
    position: relative;
    z-index: 11;
}

.eb-busca-bar {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(34, 17, 51, 0.10);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.eb-busca-bar .fa-search {
    color: var(--purple-1);
    font-size: 17px;
    flex-shrink: 0;
}

.eb-busca-bar input[type="text"] {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: transparent;
    min-width: 0;
}

.eb-busca-bar input[type="text"]::placeholder {
    color: #9a8bb3;
}

.eb-busca-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(90deg, var(--purple-1), var(--purple-2));
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 18px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.eb-busca-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(122, 40, 255, 0.3);
}

/* ====================== FILTROS ====================== */
.eb-filtros {
    padding: 24px 0 0;
}

.eb-filtros-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.eb-filtros-row label {
    font-size: 13px;
    font-weight: 600;
    color: #5a4b76;
    white-space: nowrap;
}

.eb-filtros-row select {
    padding: 8px 14px;
    border: 1px solid #e0d6f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: var(--card);
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 160px;
}

.eb-filtros-row select:focus {
    outline: none;
    border-color: var(--purple-1);
    box-shadow: 0 0 0 3px rgba(122, 40, 255, 0.1);
}

.eb-filtros-spacer {
    flex: 1;
}

.eb-resultado-info {
    font-size: 14px;
    color: #5a4b76;
    font-weight: 500;
}

.eb-resultado-info strong {
    color: var(--purple-1);
    font-weight: 700;
}

.eb-limpar-filtros {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #9a8bb3;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.eb-limpar-filtros:hover {
    color: var(--purple-1);
}

/* ====================== TITULO DE SEÇÃO ====================== */
.eb-secao-titulo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 22px;
}

.eb-secao-titulo i {
    font-size: 22px;
}

/* ====================== FAVORITOS ====================== */
.eb-favoritos {
    padding: 36px 0 12px;
    background: linear-gradient(180deg, #fdf0f4 0%, transparent 100%);
}

.eb-favoritos .eb-secao-titulo i {
    color: #e53e6b;
}

.eb-conteudo .eb-secao-titulo i {
    color: var(--purple-1);
}

/* ====================== GRID ====================== */
.eb-conteudo {
    padding: 36px 0 64px;
}

.eb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
}

/* ====================== CARD E-BOOK (visual de livro) ====================== */
.card-ebook {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid #ede8f5;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.card-ebook:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 60px rgba(122, 40, 255, 0.15),
        0 8px 20px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(122, 40, 255, 0.1);
    border-color: rgba(122, 40, 255, 0.3);
}

.card-ebook-link {
    display: block;
    text-decoration: none;
}

/* --- Wrapper do livro --- */
.card-ebook-book {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px 10px;
    background: linear-gradient(90deg, #FFFFFF 0%, #ede5ff 50%, #c2b4db 100%);
    perspective: 900px;
}

/* --- Inner: agrupa spine + pages + cover com profundidade --- */
.card-ebook-book-inner {
    position: relative;
    width: 84%;
    max-width: 220px;
    aspect-ratio: 5 / 7;
    transform-style: preserve-3d;
    transform: rotateY(-3deg);
    transition: transform 0.4s ease;
}

.card-ebook:hover .card-ebook-book-inner {
    transform: rotateY(0deg) translateY(-3px);
}

/* --- Páginas (camadas atrás da capa) --- */
.card-ebook-book-pages {
    position: absolute;
    inset: 3px -5px 3px 0;
    background: linear-gradient(90deg,
            #e8e0d4 0%,
            #f5f1ea 2px,
            #f9f6f1 3px,
            #faf8f4 4px,
            #f5f1ea 100%);
    border-radius: 1px 3px 3px 1px;
    transform: translateZ(-8px);
    box-shadow:
        2px 1px 4px rgba(0, 0, 0, 0.06),
        4px 2px 6px rgba(0, 0, 0, 0.04);
}

/* Linhas das páginas na borda direita */
.card-ebook-book-pages::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 0;
    bottom: 6px;
    width: 5px;
    background: repeating-linear-gradient(to bottom,
            #e8e0d4 0px,
            #f2ede6 1px,
            #faf8f4 1.5px,
            #e8e0d4 2px);
    border-radius: 0 2px 2px 0;
}

/* --- Lombada --- */
.card-ebook-book-spine {
    position: absolute;
    top: 0;
    left: -10px;
    bottom: 0;
    width: 10px;
    background: linear-gradient(180deg,
            rgba(91, 30, 187, 0.85) 0%,
            rgba(65, 20, 140, 0.9) 50%,
            rgba(50, 15, 110, 0.95) 100%);
    border-radius: 2px 0 0 2px;
    transform: translateZ(-4px) rotateY(0deg);
    box-shadow:
        -2px 0 6px rgba(0, 0, 0, 0.12),
        inset 1px 0 2px rgba(255, 255, 255, 0.08);
}

/* Textura sutil na lombada */
.card-ebook-book-spine::after {
    content: "";
    position: absolute;
    inset: 8px 2px 8px 3px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* --- Capa (imagem principal) --- */
.card-ebook-book-cover {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 2px 4px 4px 2px;
    overflow: hidden;
    transform: translateZ(0);
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.10),
        0 6px 20px rgba(0, 0, 0, 0.08),
        -1px 0 3px rgba(0, 0, 0, 0.05);
}

.card-ebook-book-cover>img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.card-ebook:hover .card-ebook-book-cover>img {
    transform: scale(1.04);
}

/* Reflexo sutil na capa */
.card-ebook-book-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.10) 0%,
            transparent 45%,
            transparent 55%,
            rgba(255, 255, 255, 0.03) 100%);
    pointer-events: none;
    z-index: 4;
}

/* --- Categoria sobre a capa (responsiva premium) --- */
.ebook-book-category {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(98, 22, 231, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.95);
    font-size: clamp(8.5px, 0.8vw, 10px);
    font-weight: 700;
    letter-spacing: clamp(0.3px, 0.05vw, 0.5px);
    text-transform: uppercase;
    padding: clamp(3px, 0.3vw, 4px) clamp(7px, 0.7vw, 9px);
    border-radius: clamp(3px, 0.3vw, 4px);
    line-height: 1.3;
    max-width: calc(100% - 60px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 3;
}

/* --- Selo premium (independente, canto superior direito) --- */
.ebook-premium-seal {
    position: absolute;
    top: 8px;
    right: 8px;
    height: clamp(38px, 4vw, 46px) !important;
    width: auto !important;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 3;
}

/* --- Logo central (selo editorial) --- */
.ebook-book-logo {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 4px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    z-index: 2;
    pointer-events: none;
}

.card-ebook:hover .ebook-book-logo {
    opacity: 0.55;
}

.ebook-book-logo img {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: contain;
}

/* --- Título sobre a capa (tipografia responsiva premium) --- */
.ebook-book-title-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 7px 25px 6px;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.82) 0%,
            rgba(0, 0, 0, 0.54) 52%,
            rgba(0, 0, 0, 0.16) 78%,
            transparent 100%);
    color: #fff;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.6);
    word-break: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    z-index: 3;
    letter-spacing: 0.1px;
    max-height: 34%;
}

/* Tipografia responsiva baseada no comprimento do texto + tamanho da mídia */
.ebook-book-title-overlay.ebook-titulo-curto {
    font-size: clamp(11px, 1.1vw, 14.5px);
    line-height: 1.16;
    font-weight: 800;
    letter-spacing: 0.1px;
}

.ebook-book-title-overlay.ebook-titulo-medio {
    font-size: clamp(9px, 0.88vw, 11.5px);
    line-height: 1.14;
    font-weight: 700;
    letter-spacing: 0.08px;
}

.ebook-book-title-overlay.ebook-titulo-longo {
    font-size: clamp(8px, 0.8vw, 10px);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: 0;
}

/* ====================== MEDIA QUERIES — TÍTULO + CATEGORIA ====================== */

/* --- Tablet --- */
@media (max-width: 900px) {
    .ebook-book-category {
        font-size: clamp(8px, 1.2vw, 9.5px);
        padding: 3px 7px;
        max-width: calc(100% - 52px);
    }

    .ebook-premium-seal {
        height: clamp(26px, 3.2vw, 32px);
    }

    .ebook-book-title-overlay.ebook-titulo-curto {
        font-size: clamp(13px, 2.2vw, 16px);
    }

    .ebook-book-title-overlay.ebook-titulo-medio {
        font-size: clamp(12px, 2vw, 14.5px);
    }

    .ebook-book-title-overlay.ebook-titulo-longo {
        font-size: clamp(10.5px, 1.7vw, 13px);
    }
}

/* --- Mobile grande --- */
@media (max-width: 680px) {
    .ebook-book-category {
        font-size: clamp(7.5px, 1.8vw, 9px);
        padding: 2.5px 6px;
        letter-spacing: 0.3px;
        max-width: calc(100% - 48px);
    }

    .ebook-premium-seal {
        height: clamp(24px, 3.5vw, 30px);
    }

    .ebook-book-title-overlay {
        padding: 9px 6px 5px;
        max-height: 32%;
    }

    .ebook-book-title-overlay.ebook-titulo-curto {
        font-size: clamp(10px, 2.3vw, 13px);
    }

    .ebook-book-title-overlay.ebook-titulo-medio {
        font-size: clamp(8.5px, 1.8vw, 10px);
    }

    .ebook-book-title-overlay.ebook-titulo-longo {
        font-size: clamp(7.5px, 1.6vw, 9px);
        letter-spacing: 0.1px;
    }
}

/* --- Mobile --- */
@media (max-width: 480px) {
    .ebook-book-category {
        font-size: clamp(7px, 2.3vw, 8.5px);
        padding: 2px 5px;
        top: 6px;
        left: 6px;
        letter-spacing: 0.2px;
        max-width: calc(100% - 44px);
    }

    .ebook-premium-seal {
        top: 6px;
        right: 6px;
        height: clamp(22px, 4vw, 28px);
    }

    .ebook-book-title-overlay {
        padding: 8px 5px 4px;
        max-height: 30%;
    }

    .ebook-book-title-overlay.ebook-titulo-curto {
        font-size: 10px;
    }

    .ebook-book-title-overlay.ebook-titulo-medio {
        font-size: 8px;
    }

    .ebook-book-title-overlay.ebook-titulo-longo {
        font-size: 7px;
        letter-spacing: 0;
    }
}

/* --- Body (premium com tipografia responsiva) --- */
.card-ebook-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: clamp(10px, 1.2vw, 14px) clamp(11px, 1.3vw, 15px) clamp(12px, 1.3vw, 15px);
    gap: clamp(8px, 1vw, 12px);
}

/* --- Resumo (tipografia adaptativa) --- */
.card-ebook-resumo {
    font-size: clamp(11px, 1vw, 12.5px);
    line-height: 1.5;
    color: #665c7c;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0;
}

/* --- Linha info: estrelas + preço (equilíbrio responsivo) --- */
.card-ebook-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(8px, 1vw, 12px);
    margin-top: auto;
    padding-top: clamp(4px, 0.5vw, 8px);
}

/* --- Estrelas (responsivas) --- */
.card-ebook-stars {
    display: flex;
    align-items: center;
    gap: clamp(2px, 0.3vw, 3px);
}

.card-ebook-stars .fa {
    font-size: clamp(11px, 1vw, 13px);
    color: #f5a623;
    text-shadow: 0 1px 2px rgba(245, 166, 35, 0.3);
}

.card-ebook-stars-note {
    font-size: clamp(10px, 0.95vw, 12px);
    font-weight: 700;
    color: #5a4b76;
    margin-left: clamp(4px, 0.5vw, 6px);
    letter-spacing: 0.3px;
}

/* --- Preço (destaque responsivo) --- */
.card-ebook-price-value {
    font-size: clamp(16px, 1.7vw, 20px);
    font-weight: 800;
    color: var(--purple-1);
    line-height: 1;
    white-space: nowrap;
    letter-spacing: -0.3px;
}

/* --- Botão Comprar (premium responsivo) --- */
.card-ebook-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: clamp(5px, 0.6vw, 8px);
    width: 100%;
    padding: clamp(9px, 1vw, 12px) clamp(14px, 1.6vw, 20px);
    background: linear-gradient(90deg, var(--purple-1), var(--purple-2));
    color: #fff;
    border: none;
    border-radius: clamp(8px, 0.9vw, 12px);
    font-family: inherit;
    font-size: clamp(12px, 1.15vw, 14px);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    letter-spacing: clamp(0.3px, 0.04vw, 0.5px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 8px rgba(122, 40, 255, 0.2);
}

.card-ebook-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(122, 40, 255, 0.35), 0 2px 8px rgba(122, 40, 255, 0.2);
}

.card-ebook-buy.is-added {
    background: linear-gradient(90deg, #2e7d32, #388e3c);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.25);
    pointer-events: none;
}

/* --- Ações rápidas (favorito + carrinho) --- */
.ebook-card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
    opacity: 0;
    transform: translateX(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.card-ebook:hover .ebook-card-actions {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.ebook-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #5a4b76;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.ebook-action-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
}

.ebook-action-favorite:hover,
.ebook-action-favorite.is-favorited {
    background: rgba(255, 255, 255, 0.95);
    color: #e53935;
}

.ebook-action-favorite.is-favorited .fa {
    font-weight: 900;
}

.ebook-action-cart:hover {
    background: var(--purple-1);
    color: #fff;
}

.ebook-action-cart.is-added {
    background: var(--purple-1);
    color: #fff;
    pointer-events: none;
}

/* Mobile: sempre visíveis */
@media (max-width: 680px) {
    .ebook-card-actions {
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }

    .ebook-action-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* ====================== PAGINAÇÃO ====================== */
.eb-paginacao {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.eb-paginacao a,
.eb-paginacao span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.eb-paginacao a {
    background: var(--card);
    color: var(--text);
    border: 1px solid #ede8f5;
}

.eb-paginacao a:hover {
    border-color: var(--purple-1);
    color: var(--purple-1);
    background: #f7f1ff;
}

.eb-paginacao .pag-atual {
    background: linear-gradient(90deg, var(--purple-1), var(--purple-2));
    color: #fff;
    border: none;
}

.eb-paginacao .pag-nav {
    gap: 6px;
    font-size: 13px;
}

.eb-paginacao .pag-dots {
    color: #9a8bb3;
    border: none;
    background: none;
    min-width: auto;
    padding: 0 4px;
}

/* ====================== VAZIO ====================== */
.eb-vazio {
    text-align: center;
    padding: 60px 20px;
    color: #9a8bb3;
}

.eb-vazio .fa {
    font-size: 56px;
    color: #d4c6f0;
    margin-bottom: 16px;
    display: block;
}

.eb-vazio p {
    font-size: 16px;
    margin: 0 0 4px;
}

.eb-vazio a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    margin-top: 20px;
    background: linear-gradient(90deg, var(--purple-1), var(--purple-2));
    color: #fff;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.eb-vazio a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(122, 40, 255, 0.3);
}

/* ====================== VOLTAR ====================== */
.eb-voltar-wrap {
    text-align: center;
    margin-top: 32px;
}

.eb-voltar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--purple-1);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: gap 0.2s;
}

.eb-voltar-link:hover {
    gap: 12px;
}

/* ====================== RESPONSIVO ====================== */
@media (max-width: 1100px) {
    .eb-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .eb-hero {
        padding: 48px 0 36px;
    }

    .eb-hero-row {
        flex-direction: column;
        text-align: center;
    }

    .eb-hero-img {
        flex: none;
        max-width: 320px;
        width: 100%;
        order: -1;
        margin: 0;
    }

    .eb-hero h1 {
        font-size: 28px;
    }

    .eb-hero-stats {
        gap: 20px;
        justify-content: center;
    }

    .eb-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 18px;
    }

    .eb-filtros-row {
        gap: 8px;
    }
}

@media (max-width: 680px) {
    .eb-hero {
        padding: 36px 0 28px;
    }

    .eb-hero-stats {
        gap: 16px;
    }

    .eb-hero-stat-num {
        font-size: 22px;
    }

    .eb-busca-bar {
        padding: 8px 14px;
    }

    .eb-filtros-row {
        flex-direction: column;
        align-items: stretch;
    }

    .eb-filtros-row select {
        min-width: auto;
        width: 100%;
    }

    .eb-filtros-spacer {
        display: none;
    }
}

@media (max-width: 480px) {
    .eb-hero {
        padding: 28px 0 20px;
    }

    .eb-hero h1 {
        font-size: 24px;
    }

    .eb-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .card-ebook-book {
        padding: 10px 8px 8px;
    }

    .card-ebook-book-inner {
        width: 86%;
    }

    .card-ebook-book-spine {
        width: 8px;
        left: -8px;
    }

    .ebook-book-logo {
        padding: 3px;
    }

    .ebook-book-logo img {
        width: 36px;
        height: 36px;
    }
}

/* ====================== CARD RESPONSIVO — TIPOGRAFIA COMPLETA ====================== */

/* --- Desktop grande (1440px+) --- */
@media (min-width: 1440px) {
    .card-ebook-body {
        padding: 14px 16px 16px;
        gap: 12px;
    }

    .card-ebook-resumo {
        font-size: 12.5px;
        line-height: 1.55;
        -webkit-line-clamp: 3;
    }

    .card-ebook-stars .fa {
        font-size: 14px;
    }

    .card-ebook-stars-note {
        font-size: 13px;
    }

    .card-ebook-price-value {
        font-size: 21px;
    }

    .card-ebook-buy {
        font-size: 14.5px;
        padding: 13px 22px;
        border-radius: 12px;
    }
}

/* --- Tablet (680px–900px) --- */
@media (max-width: 900px) and (min-width: 681px) {
    .card-ebook-body {
        padding: 12px 12px 12px;
        gap: 10px;
    }

    .card-ebook-resumo {
        font-size: 11px;
        line-height: 1.5;
        -webkit-line-clamp: 3;
    }

    .card-ebook-stars .fa {
        font-size: 12px;
    }

    .card-ebook-stars-note {
        font-size: 11px;
    }

    .card-ebook-price-value {
        font-size: 17px;
    }

    .card-ebook-buy {
        font-size: 12.5px;
        padding: 10px 16px;
    }
}

/* --- Mobile grande (481px–680px) --- */
@media (max-width: 680px) and (min-width: 481px) {
    .card-ebook-body {
        padding: 10px 10px 12px;
        gap: 8px;
    }

    .card-ebook-resumo {
        font-size: 10.5px;
        line-height: 1.45;
        -webkit-line-clamp: 2;
    }

    .card-ebook-stars .fa {
        font-size: 11.5px;
    }

    .card-ebook-stars-note {
        font-size: 10.5px;
    }

    .card-ebook-price-value {
        font-size: 16px;
    }

    .card-ebook-buy {
        font-size: 12px;
        padding: 9px 14px;
        border-radius: 8px;
    }
}

/* --- Mobile (≤480px) --- */
@media (max-width: 480px) {
    .card-ebook-body {
        padding: 8px 9px 10px;
        gap: 6px;
    }

    .card-ebook-resumo {
        font-size: 10px;
        line-height: 1.4;
        -webkit-line-clamp: 2;
    }

    .card-ebook-info-row {
        gap: 5px;
        padding-top: 2px;
    }

    .card-ebook-stars .fa {
        font-size: 10px;
    }

    .card-ebook-stars-note {
        font-size: 9.5px;
        margin-left: 3px;
    }

    .card-ebook-price-value {
        font-size: 15px;
    }

    .card-ebook-buy {
        font-size: 11px;
        padding: 8px 12px;
        gap: 4px;
        border-radius: 7px;
    }

    .eb-paginacao a,
    .eb-paginacao span {
        min-width: 34px;
        height: 34px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {

    .card-ebook-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .card-ebook-stars {
        width: 100%;
        justify-content: flex-start;
    }

    .card-ebook-price-value {
        width: 100%;
        text-align: right;
        font-size: 14px;
    }

    .card-ebook-buy {
        font-size: 0;
        /* esconde o texto original */
    }

    .card-ebook-buy i {
        font-size: 12px;
        /* mantém o ícone visível */
        margin-right: 4px;
    }

    .card-ebook-buy::after {
        content: "Comprar";
        font-size: 12px;
        font-weight: 700;
    }

    .ebook-book-title-overlay {
        padding: 10px 3px 40px 3px;
    }
}