/* --- Estilos Generales --- */
#novedades-main { padding-top: 0; background-color: #f4f6f9; }
.gallery-container { max-width: 1200px; margin: 0 auto; padding: 2em 20px; }

/* --- Cabecera con Imagen --- */
.page-banner { position: relative; padding: 5em 2em; text-align: center; color: white; background-image: url('../images/novedades_header.jpg'); background-size: cover; background-position: center; }
.page-banner::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.4); }
.page-banner * { position: relative; z-index: 1; }
.page-banner h1 { font-size: 3em; font-weight: 700; text-shadow: 2px 2px 8px rgba(0,0,0,0.7); }

/* --- Interruptor de Idioma --- */
.lang-switcher { text-align: center; margin-bottom: 2.5em; }
.lang-btn { background: none; border: 1px solid #ccc; border-radius: 15px; padding: 8px 15px; cursor: pointer; font-size: 0.9em; transition: all 0.3s ease; }
.lang-btn:hover { border-color: #383b75; background: #f0f0f0; }
.lang-btn.lang-btn-active { border-color: #383b75; background: #383b75; color: white; font-weight: bold; }

/* --- Controles de Búsqueda --- */
.controls-container { text-align: center; margin-bottom: 2.5em; }
#search-box { border: 1px solid #ccc; border-radius: 20px; padding: 12px 20px; font-size: 1em; width: 100%; max-width: 450px; transition: box-shadow 0.3s; text-align: center; }
#search-box:focus { box-shadow: 0 0 8px rgba(56, 59, 117, 0.4); outline: none; }

/* --- Sección de Recomendador --- */
.recommender-section { text-align: center; margin-bottom: 3em; padding: 2.5em; background-color: #ffffff; border-radius: 12px; box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.recommender-section h2 { font-size: 2em; color: #333; margin-top: 0; margin-bottom: 1em; font-weight: 600; }
.theme-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
.theme-tag { background-color: #e9e9e9; color: #333; border: none; border-radius: 20px; padding: 12px 22px; font-size: 1em; font-weight: 500; cursor: pointer; transition: all 0.3s ease; }
.theme-tag:hover { background-color: #d9534f; color: white; transform: translateY(-2px); }
.theme-tag.theme-tag-active { background-color: #383b75; color: white; font-weight: 600; }
#random-book-btn { background-color: #ffc107; color: #333; }
#random-book-btn:hover { background-color: #ffca2c; }

/* --- Cuadrícula de Libros --- */
.grid-title { text-align: center; font-size: 1.5em; color: #444; margin-bottom: 1.5em; border-top: 1px solid #ddd; padding-top: 2em; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 25px; }
.book-card { position: relative; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.08); transition: all 0.3s ease; background-color: white; cursor: pointer; }
.book-card.hidden { display: none; }
.book-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.12); }
.book-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.book-card:hover img { transform: scale(1.05); }
.book-card .overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 70%); color: white; display: flex; flex-direction: column; justify-content: flex-end; padding: 15px; opacity: 0; transition: opacity 0.4s ease; text-shadow: 1px 1px 3px rgba(0,0,0,0.7); pointer-events: none; }
.book-card:hover .overlay { opacity: 1; }
.overlay .book-title { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; }
.overlay .book-author { font-size: 0.9em; }

.badge { position: absolute; top: 12px; left: -35px; background-color: #d9534f; color: white; padding: 5px 30px; font-size: 0.8em; font-weight: bold; transform: rotate(-45deg); box-shadow: 0 2px 4px rgba(0,0,0,0.2); z-index: 2; }

/* --- Modal (Ventana Emergente) --- */
body.modal-open { overflow: hidden; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: none; justify-content: center; align-items: center; z-index: 1000; animation: fadeIn 0.3s ease; }
.modal-overlay.modal-is-active { display: flex; }
.modal-content { background: white; padding: 30px; border-radius: 8px; max-width: 800px; width: 90%; max-height: 90vh; overflow-y: auto; position: relative; display: flex; gap: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); animation: slideIn 0.4s ease-out; }
.modal-close { position: absolute; top: 10px; right: 15px; font-size: 2em; line-height: 1; cursor: pointer; color: #aaa; transition: color 0.2s; }
.modal-close:hover { color: #333; }
.modal-cover { flex-basis: 35%; flex-shrink: 0; }
.modal-cover img { width: 100%; border-radius: 4px; }
.modal-info { flex-basis: 65%; }
.modal-info h2 { margin-top: 0; color: #383b75; }
.modal-info .author { font-style: italic; color: #666; margin-bottom: 1em; }
.modal-info .description { line-height: 1.6; }
.modal-info .catalog-button { display: inline-block; background-color: #d9534f; color: white; padding: 10px 18px; border-radius: 5px; text-decoration: none; font-weight: bold; margin-top: 1.5em; }

.social-share { margin-top: 2em; padding-top: 1em; border-top: 1px solid #eee; text-align: left; }
.social-share p { margin: 0 0 10px 0; font-weight: bold; color: #555; }
.social-btn { display: inline-block; margin-right: 15px; font-size: 1.8em; color: #555; transition: color 0.3s, transform 0.3s; }
.social-btn:hover { transform: scale(1.1); }
.social-btn.whatsapp:hover { color: #25D366; }
.social-btn.mastodon:hover { color: #6364FF; }
.social-btn.bluesky:hover { color: #0078FF; }

/* --- [NUEVO] Área de Notificación --- */
.notification-area {
    margin-bottom: 2em;
}
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 1.5em;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}
.error-message .icon {
    font-size: 1.5em;
}


/* --- MEDIA QUERY PARA MÓVILES --- */
@media (max-width: 768px) {
    .page-banner { padding: 3em 1em; }
    .page-banner h1 { font-size: 2.2em; }
    .recommender-section { padding: 1.5em 1em; margin-bottom: 2.5em; background-color: transparent; box-shadow: none; }
    .recommender-section h2 { font-size: 1.8em; }
    .theme-tags { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .theme-tag { font-size: 0.9em; padding: 10px 15px; }
    .theme-tags .theme-tag:first-child, #random-book-btn { grid-column: 1 / -1; }
    .grid-title { font-size: 1.3em; padding-top: 1.5em; margin-top: 1.5em;}
    .book-grid { grid-template-columns: 1fr 1fr; gap: 15px; }
    .modal-content { flex-direction: column; }
}

/* --- Animaciones --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
