/* ============================================================
   VARIABLES GLOBALES
   ============================================================ */

:root {
    --primary: #d4af37;
    --primary-dark: #b8932f;
    --dark: #111;
    --light: #f7f7f7;
    --text: #222;
    --white: #ffffff;

    --radius: 12px;
    --shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* ============================================================
   RESET GLOBAL
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   NAVBAR
   ============================================================ */

header {
    background: var(--dark);
    padding: 20px 50px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    color: var(--white);
    font-size: 1.6rem;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: var(--white);
    transition: 0.3s;
    font-size: 1rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* ============================================================
   ICONO DEL CARRITO
   ============================================================ */

.cart-icon {
    color: var(--white);
    background: var(--primary);
    padding: 10px 16px;
    border-radius: 50px;
    font-weight: bold;
    text-decoration: none;
    transition: 0.3s;
}

.cart-icon:hover {
    transform: scale(1.05);
}

/* ============================================================
   HERO PRINCIPAL
   ============================================================ */

.hero {
    height: 90vh;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5));
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
    padding: 20px;
}

.hero-content {
    max-width: 700px;
}

.hero h1 {
    font-size: 4rem;
    font-family: 'Playfair Display', serif;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* ============================================================
   BOTONES
   ============================================================ */

.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: 0.3s ease;
    box-shadow: var(--shadow);
    background: var(--primary);
    color: var(--dark);
    text-align: center;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ============================================================
   SECCIONES GENERALES
   ============================================================ */

.books-section,
.featured-section,
.about-section,
.contact-section,
.cart-page {
    padding: 80px 10%;
}

.page-header {
    padding: 80px 10% 20px;
    text-align: center;
}

.page-header h1,
.featured-section h2 {
    font-size: 2.5rem;
}

/* ============================================================
   GRID DE LIBROS
   ============================================================ */

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.book-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.book-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.book-card-content {
    padding: 20px;
}

.price {
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 10px;
}

/* ============================================================
   FIX PARA ORIGINAL E‑BOOKS
   ============================================================ */

#ebooks-grid .book-card img {
    height: auto;
    max-height: 300px;
    object-fit: contain;
    background: #fff;
    padding: 10px;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */

.about-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
}

.about-image img {
    width: 100%;
    max-width: 500px;
    height: 650px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.about-text {
    flex: 1;
    min-width: 300px;
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */

.contact-card {
    background: var(--white);
    padding: 30px;
    margin-top: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: 500px;
}

/* ============================================================
   CART PAGE
   ============================================================ */

.cart-item {
    background: var(--white);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

/* ============================================================
   PRODUCT VIEW
   ============================================================ */

.product-view {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
}

.product-container {
    display: flex;
    gap: 40px;
    max-width: 900px;
    width: 100%;
    align-items: flex-start;
}

.product-image img {
    width: 320px;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.product-info {
    flex: 1;
    padding-top: 10px;
}

.product-info h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.product-price {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--primary);
}

.product-desc {
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* ============================================================
   BOTÓN ADD TO CART (CENTRADO)
   ============================================================ */

.add-btn {
    width: 100%;
    max-width: 280px;
    padding: 12px;
    font-size: 18px;
    background: #0077ff;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    display: block;
    margin: 0 auto;
}

.add-btn:hover {
    background: #005fcc;
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
    background: var(--dark);
    color: var(--white);
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    opacity: 0.85;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {

    header {
        padding: 15px 20px;
    }

    .navbar {
        flex-direction: column;
        gap: 20px;
    }

    .nav-links {
        justify-content: center;
        gap: 15px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .about-container {
        flex-direction: column;
        text-align: center;
    }

    /* PRODUCT VIEW FIX */
    .product-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .product-image img {
        width: 80%;
        max-width: 280px;
    }

    .product-info {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .add-btn {
        width: 100%;
        max-width: 280px;
        margin-top: 10px;
    }

    .quantity-controls {
        justify-content: center;
    }
}
