/* 
* EbookStore - Custom CSS
* Estilos personalizados para o site de venda de ebooks
*/

/* Variáveis CSS */
:root {
    --primary-color: #4e73df;
    --secondary-color: #6c757d;
    --accent-color: #f6c23e;
    --success-color: #1cc88a;
    --danger-color: #e74a3b;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --body-bg: #f8f9fc;
    --card-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

/* Estilos Gerais */
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--body-bg);
    color: #333;
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    transition: all 0.3s ease;
}

a:hover {
    color: #2e59d9;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #2e59d9;
    border-color: #2e59d9;
}

.text-primary {
    color: var(--primary-color) !important;
}

/* Header e Navegação */
.site-header {
    position: relative;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.5rem;
}

.navbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    position: relative;
}

.navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 3px;
    background-color: var(--primary-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    color: white;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/pattern.png');
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 2rem 0 rgba(58, 59, 69, 0.2);
}

.card-img-top {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    height: 200px;
    object-fit: cover;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

.badge-primary {
    background-color: var(--primary-color);
}

.badge-secondary {
    background-color: var(--secondary-color);
}

.badge-success {
    background-color: var(--success-color);
}

.badge-danger {
    background-color: var(--danger-color);
}

/* Categorias */
.category-card {
    position: relative;
    height: 150px;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:hover img {
    transform: scale(1.05);
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-name {
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
    text-align: center;
}

/* Produto Detalhe */
.product-image {
    border-radius: 0.5rem;
    box-shadow: var(--card-shadow);
}

.product-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.product-description {
    margin-bottom: 1.5rem;
}

.product-meta {
    margin-bottom: 1.5rem;
}

.product-meta-item {
    margin-bottom: 0.5rem;
}

/* Carrinho */
.cart-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.cart-item-image {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.25rem;
}

.cart-summary {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

/* Blog */
.blog-post {
    margin-bottom: 2rem;
}

.blog-post-image {
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    height: 250px;
    object-fit: cover;
}

.blog-post-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.blog-post-meta {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.blog-post-excerpt {
    margin-bottom: 1rem;
}

/* Formulários */
.form-control {
    border-radius: 0.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Responsividade */
@media (max-width: 767.98px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .product-title {
        font-size: 1.5rem;
    }
    
    .product-price {
        font-size: 1.5rem;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Paginação */
.pagination .page-link {
    color: var(--primary-color);
    border: none;
    margin: 0 0.25rem;
    border-radius: 0.25rem;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 1rem 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
}

/* Botão Voltar ao Topo */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Loader */
.loader {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(78, 115, 223, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
