/* assets/css/styles.css */

/* Fuentes y estilos globales */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.top-bar {
    background-color: #f7f7f7;
    text-align: center;
    padding: 8px 0;
    font-size: 14px;
    color: #666;
}

.top-bar .container {
    display: flex;
    justify-content: center;
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    max-height: 40px;
}

.search-bar {
    display: flex;
    flex-grow: 1;
    max-width: 600px;
    margin: 0 20px;
    border: 1px solid #ddd;
    border-radius: 20px;
    overflow: hidden;
}

.search-input {
    border: none;
    padding: 10px 15px;
    width: 100%;
    outline: none;
}

.search-button {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

.bottom-nav {
    background-color: #eee;
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1);
}

.bottom-nav .container {
    padding: 10px 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.bottom-nav nav {
    display: flex;
    gap: 25px;
    white-space: nowrap;
}

.nav-item {
    text-decoration: none;
    color: #555;
    font-size: 15px;
    padding: 5px 0;
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #007bff;
    transition: width 0.3s ease;
}

.nav-item:hover::after {
    width: 100%;
}

/* Sección principal del héroe */
.hero-section {
    background-image: url("https://cdn.pixabay.com/photo/2018/07/17/14/43/banner-3544296_1280.jpg");
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 100px 0;
    text-align: left;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Overlay oscuro */
    z-index: -1;
}

.hero-content {
    max-width: 50%;
    margin-left: auto;
    padding-left: 20px;
}

.hero-title {
    font-size: 4em;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.2em;
    margin-bottom: 20px;
}

.hero-button {
    background-color: #fff;
    color: #000;
    border: none;
    padding: 12px 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
}

/* Book Section - Nuevos estilos */
.book-section {
    padding: 40px 0;
}

.book-section h2 {
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    color: #1a202c;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.book-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.book-card:hover {
    transform: translateY(-5px);
}

.book-image-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 150%; /* Esto mantiene una relación de aspecto 2:3 para la portada */
}

.book-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ef4444; /* Rojo */
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.8em;
    z-index: 10;
}

.book-card-content {
    padding: 15px;
    text-align: center;
}

.book-card-content h3 {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
    color: #1a202c;
}

.book-author {
    font-size: 0.9em;
    color: #6b7280;
    margin-bottom: 10px;
}

.book-price {
    font-size: 1.5em;
    font-weight: bold;
    color: #000;
    margin-bottom: 15px;
}

.book-card-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    display: inline-block;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-details {
    background-color: #eee;
    color: #333;
    border: 1px solid #ddd;
}

.btn-details:hover {
    background-color: #e2e8f0;
}

.btn-add-to-cart {
    background-color: #3182ce; /* Azul */
    color: #fff;
    border: none;
}

.btn-add-to-cart:hover {
    background-color: #2c5282;
}

/* Footer */
.main-footer {
    background-color: #333;
    color: #fff;
    padding: 20px 0;
    text-align: center;
}

/* Media Queries para responsividad */
@media (max-width: 768px) {
    .main-nav .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .search-bar {
        width: 100%;
        margin: 0;
    }

    .nav-links {
        width: 100%;
        justify-content: space-around;
        gap: 0;
    }
    
    .hero-section {
        padding: 50px 0;
    }

    .hero-content {
        max-width: 100%;
        margin-left: 0;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5em;
    }
    
    .hero-subtitle {
        font-size: 1em;
    }

    .bottom-nav .container {
        padding: 10px;
    }
    
    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .book-card-buttons {
        flex-direction: column;
        gap: 5px;
    }
}
