/* --- Variables y Estilos Globales --- */
:root {
    --primary-color: #8B4513; /* SaddleBrown - Marrón cálido */
    --secondary-color: #FDF5E6; /* OldLace - Crema suave */
    --dark-color: #2F2F2F;
    --text-color: #444;
    --white: #FFFFFF;
    
    --font-heading: 'Lora', serif;
    --font-body: 'Lato', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--dark-color);
}

/* --- Header y Navegación --- */
.header {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.cart-icon {
    position: relative;
    cursor: pointer;
}

.cart-icon .bx { font-size: 1.8rem; }

.cart-counter {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
}

/* --- Hero Section --- */
.hero {
    height: 60vh;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--white);
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 30px;
}

.search-bar {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

.search-bar input {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 5px 0 0 5px;
    font-size: 1rem;
    font-family: var(--font-body);
}

.search-bar button {
    padding: 0 20px;
    border: none;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-size: 1.5rem;
}

/* --- Book Section --- */
.book-section {
    padding: 80px 20px;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}

.book-card {
    display: flex;
    flex-direction: column;
}

.book-card img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover img {
    transform: translateY(-8px);
    box-shadow: 0 15px 25px rgba(0,0,0,0.15);
}

.book-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-top: 15px;
}

.book-card .author {
    color: #777;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.btn-add-cart {
    background: none;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-add-cart:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* --- Genres Section --- */
.genres-section {
    background-color: var(--secondary-color);
    padding: 60px 20px;
}

.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.genre-card {
    background-color: var(--white);
    padding: 25px;
    text-align: center;
    border-radius: 5px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.genre-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    color: var(--primary-color);
}
.genre-card .bx { font-size: 1.5rem; }

/* --- Footer --- */
.footer {
    background-color: var(--dark-color);
    color: #ccc;
    padding: 30px 0;
    text-align: center;
}
.footer .social-links { margin-top: 10px; }
.social-links a { color: #ccc; margin: 0 10px; font-size: 1.5rem; }

/* --- Notificación Toast --- */
#toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dark-color);
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
    z-index: 1000;
}

#toast.show {
    opacity: 1;
    visibility: visible;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-content h1 { font-size: 2.5rem; }
}