 /* Estilos generales */
 * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #1a5276;
    --secondary: #2e86c1;
    --accent: #f39c12;
    --light: #ecf0f1;
    --dark: #2c3e50;
}

body {
    background-color: #f5f5f5;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    margin: 40px 0 20px;
    color: var(--primary);
    font-size: 32px;
    position: relative;
}

.section-title::after {
    content: "";
    display: block;
    width: 100px;
    height: 3px;
    background-color: var(--accent);
    margin: 10px auto;
}

/* Header y Navegación */
header {
    background-color: var(--primary);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
}

.logo i {
    margin-right: 10px;
    font-size: 28px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav li {
    margin-left: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    padding: 10px 15px;
    border-radius: 4px;
}

nav a:hover {
    background-color: var(--secondary);
}

.cart-icon {
    position: relative;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--accent);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Hero Section */
.hero {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../img/fondo.png');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 30px;
}

.btn {
    display: inline-block;
    background-color: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

.btn:hover {
    background-color: #e67e22;
    transform: translateY(-2px);
}

/* Catálogo de Libros */
.catalog {
    padding: 50px 0;
    background-color: white;
}

.filters {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background-color: var(--light);
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--secondary);
    color: white;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.book-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.book-card:hover {
    transform: translateY(-10px);
}

.book-image {
    height: 385px;
    width: 100%;
    object-fit: cover;
    align-items: center;
}

.book-info {
    padding: 20px;
}

.book-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--dark);
}

.book-author {
    color: #7f8c8d;
    margin-bottom: 10px;
}

.book-price {
    font-weight: bold;
    color: var(--primary);
    font-size: 18px;
    margin-bottom: 10px;
}

.stock {
    font-size: 14px;
    margin-bottom: 15px;
}

.in-stock {
    color: #27ae60;
}

.low-stock {
    color: #f39c12;
}

.out-stock {
    color: #c0392b;
}

.book-actions {
    display: flex;
    justify-content: space-between;
}

.book-btn {
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.add-cart {
    background-color: var(--primary);
    color: white;
}

.add-cart:hover {
    background-color: var(--secondary);
}

.view-details {
    background-color: var(--light);
    color: var(--dark);
}

.view-details:hover {
    background-color: #d0d3d4;
}

/* Sobre Nosotros */
.about {
    padding: 50px 0;
    background-color: #f9f9f9;
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
}

.about-image {
    flex: 1;
    min-width: 300px;
}

.about-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.about-text {
    flex: 2;
    min-width: 300px;
}

.about-text h3 {
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 15px;
}

/* Formulario de Contacto */
.contact {
    padding: 50px 0;
    background-color: white;
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-info h3 {
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.info-item i {
    color: var(--primary);
    font-size: 20px;
    margin-right: 15px;
    margin-top: 5px;
}

.contact-form {
    flex: 2;
    min-width: 300px;
}

form {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--dark);
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

textarea {
    height: 150px;
}

.submit-btn {
    background-color: var(--primary);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.submit-btn:hover {
    background-color: var(--secondary);
}

/* Footer */
footer {
    background-color: var(--dark);
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 40px;
}

.footer-column {
    flex: 1;
    min-width: 200px;
}

.footer-column h4 {
    margin-bottom: 20px;
    font-size: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h4::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: all 0.3s;
}

.social-links a:hover {
    background-color: var(--accent);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: #bdc3c7;
}

/* Carrito de compras */
.cart-modal {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background-color: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease-in-out;
    z-index: 1001;
    overflow-y: auto;
}

.cart-modal.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: var(--primary);
    color: white;
}

.close-cart {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.cart-items {
    padding: 20px;
}

.cart-item {
    display: flex;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.cart-item-img {
    width: 80px;
    height: 120px;
    object-fit: cover;
    margin-right: 15px;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 16px;
}

.cart-item-price {
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 10px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.quantity-input {
    width: 50px;
    text-align: center;
    margin: 0 10px;
    padding: 5px;
}

.remove-item {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    margin-top: 10px;
    font-size: 14px;
}

.cart-total {
    padding: 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

.total-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.checkout-btn:hover {
    background-color: #e67e22;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.overlay.active {
    display: block;
}

/* Estilos para el lector de libros digitales */
.ebook-reader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 80%;
    max-width: 1000px;
    height: 80vh;
    background-color: white;
    z-index: 2000;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: none;
    opacity: 0;
    transition: all 0.3s;
}

.ebook-reader.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.reader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--primary);
    color: white;
    border-radius: 8px 8px 0 0;
}

.reader-title {
    font-size: 20px;
}

.close-reader {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.reader-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    line-height: 1.8;
    font-size: 18px;
}

.reader-footer {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    background-color: #f5f5f5;
    border-radius: 0 0 8px 8px;
}

.page-controls {
    display: flex;
    gap: 15px;
}

.page-btn {
    background-color: var(--secondary);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.page-info {
    display: flex;
    align-items: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
    }

    .logo {
        margin-bottom: 15px;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    nav li {
        margin: 5px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .cart-modal {
        width: 100%;
        right: -100%;
    }

    .ebook-reader {
        width: 95%;
        height: 90vh;
    }
}