* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body {
    background: #f2f4f8;
    color: #333;
}

/* HEADER */
header {
    background: linear-gradient(135deg,#2563eb,#1e40af);
    color: white;
    text-align: center;
    padding: 40px;
}

/* CARRINHO */
#carrinho-info {
    background: white;
    padding: 15px;
    position: sticky;
    top: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,.1);
    z-index: 10;
}

.carrinho-container {
    max-width: 1000px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* BOTÕES */
button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

button:hover { transform: translateY(-2px); }

.cancelar {
    background: #ccc;
    color: #333;
}

/* CATÁLOGO */
.catalogo {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
    gap: 25px;
    padding: 40px;
}

.ebook {
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,.1);
}

.ebook img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
}

.ebook data {
    display: block;
    margin: 10px 0;
    font-size: 1.3rem;
    color: #16a34a;
}

/* PAGINAÇÃO */
.paginacao {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.paginacao button {
    background: #e5e7eb;
    color: #333;
}

.paginacao button.ativo {
    background: #2563eb;
    color: white;
}

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: none;
    justify-content: center;
    align-items: center;
}

.modal.ativo { display: flex; }

.modal-conteudo {
    background: white;
    padding: 25px;
    border-radius: 14px;
    width: 90%;
    max-width: 420px;
}

.item-modal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
}

.controles {
    display: flex;
    gap: 6px;
}

.controles button { padding: 6px 10px; }

.controles .remover { background: #ef4444; }

/* LOADING */
.loading {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.85);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 999;
}

.loading.ativo { display: flex; }

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #ddd;
    border-top: 5px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* TOAST */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #2563eb;
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: .4s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ANIMAÇÕES */
.motion {
    opacity: 0;
    transform: translateY(40px);
}

.motion.show {
    opacity: 1;
    transform: translateY(0);
    transition: .7s ease;
}

footer {
    text-align: center;
    padding: 30px;
    background: #1e40af;
    color: white;
}
