/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global guards to avoid horizontal overflow on mobile */
html, body { max-width: 100%; }
body {
    overflow-x: hidden;
    touch-action: pan-y;
    overscroll-behavior-x: none;
}

/* Ensure media scale within containers */
img, video, canvas, svg { max-width: 100%; height: auto; }
a img { display: block; }

/* Comportamiento por defecto (desktop): ocultar menú móvil y botón perfil móvil */
.menu-movil { display: none; }
.btn-perfil-mobile { display: none; }


body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: #ffffff;
    overflow-x: hidden;
}

/* Sección Hero con fondo original */
.hero-section {
    display: none;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: center;
    min-height: 500px;
}

.hero-text {
    z-index: 2;
}

.hero-title {
    margin-bottom: 2rem;
    line-height: 1.2;
}

.title-main {
    display: block;
    font-size: 2rem;
    font-weight: 400;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.title-highlight {
    display: block;
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #dc2626, #ef4444, #f87171);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.title-subtitle {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    font-style: italic;
}

.hero-description {
    font-size: 1.25rem;
    color: #6b7280;
    margin-bottom: 2.5rem;
    line-height: 1.7;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    color: #475569;
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(100, 116, 139, 0.2);
}

.btn-primary img, .btn-secondary img {
    width: 20px;
    height: 20px;
}

/* Decoración Hero */
.hero-decoration {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-books {
    position: relative;
    width: 250px;
    height: 250px;
}

.book {
    position: absolute;
    font-size: 3rem;
    animation: float 6s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.book-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.book-2 {
    top: 10%;
    right: 20%;
    animation-delay: 1.5s;
}

.book-3 {
    bottom: 30%;
    left: 20%;
    animation-delay: 3s;
}

.book-4 {
    bottom: 10%;
    right: 10%;
    animation-delay: 4.5s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(5deg);
    }
    50% {
        transform: translateY(-10px) rotate(-3deg);
    }
    75% {
        transform: translateY(-15px) rotate(2deg);
    }
}

/* Responsive Hero */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
        padding: 2rem 0;
    }
    
    .title-highlight {
        font-size: 2.5rem;
    }
    
    .title-main {
        font-size: 1.5rem;
    }
    
    .title-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .floating-books {
        width: 200px;
        height: 200px;
    }
    
    .book {
        font-size: 2rem;
    }
}

/* Header y Navegación */
header {
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem ;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #1f2937;
}

.logo-img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    
}



.logo-text span {
    font-size: 1.25rem;
    font-weight: 700;
    color: #dc2626;
    display: block;
    line-height: 1.2;
}

.logo-text p {
    font-size: 0.875rem;
    color: #4b5563;
    margin: 0;
}



/* Navegación */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #1f2937;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background: #fef2f2;
    color: #dc2626;
    transform: translateY(-2px);
}

.nav-links img {
    width: 20px;
    height: 20px;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.nav-links a:hover img {
    filter: grayscale(0%);
}

/* Modal de perfil */
.modal_perfil-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal_perfil-btn:hover {
    background: #fef2f2;
    transform: scale(1.1);
}

.modal_perfil-btn img {
    width: 24px;
    height: 24px;
}

.modal-perfil {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000 !important; /* por encima de cualquier dropdown */
    backdrop-filter: blur(5px);
}

.modal-perfil.active {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1rem;
}

.modal-content-perfil {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 400px;
    width: 90%;
    position: relative;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 80px;
    margin-right: 20px;
}

/* Información del usuario */
.user-info {
    margin-bottom: 2rem;
}

.user-info h3 {
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    border-bottom: 2px solid #dc2626;
    padding-bottom: 0.5rem;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-details p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-radius: 10px;
    margin: 0;
    font-size: 0.95rem;
    border-left: 4px solid #dc2626;
}

.user-details p strong {
    color: #374151;
    font-weight: 600;
    min-width: 80px;
}

.user-details p:nth-child(even) {
    background: #fef2f2;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
    z-index: 10;
}

.close-btn:hover {
    color: #ffffff;
    background: #dc2626;
    transform: scale(1.1);
}

.btn-logout, .btn-iniciar-sesion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.3);
}

.btn-logout:hover, .btn-iniciar-sesion:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(220, 38, 38, 0.4);
}

.btn-logout img, .btn-iniciar-sesion img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

/* Selects */
select {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    background: #ffffff;
    color: #1f2937;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

select:focus {
    outline: none;
    border-color: #ff8f8f;
    
}


/* Menú móvil */
.menu-movil {
    display: none;
    flex-direction: column;
    position: relative;
}

.menu-movil button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.menu-movil button:hover {
    background: #fef2f2;
}

.menu-movil button img {
    width: 24px;
    height: 24px;
}

.menu-movil .menu-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    padding: 0.25rem; /* separación interna para que el contenido no pegue a los bordes */
    min-width: 220px;
    max-width: 95vw; /* que nunca desborde pantalla en móvil */
    overflow-x: hidden;
    z-index: 1500; /* por debajo del overlay del modal */
    margin-top: 0.5rem;
}

/* Flex column para ordenar las barras y anclar .bar3 al fondo */
.menu-movil.active .menu-content {
    display: flex;
    flex-direction: column;
}

.menu-movil .bar1,
.menu-movil .bar2,
.menu-movil .bar3 {
    padding: 0.5rem 0;
}

/* Empujar barra de acciones al fondo del dropdown */
.menu-movil .bar3 { margin-top: auto; }

.menu-movil .bar1 {
    border-bottom: 1px solid #e5e7eb;
}

.menu-movil .bar2 {
    border-bottom: 1px solid #e5e7eb;
}

.menu-movil a {
    display: block;
    padding: 0.75rem 1rem;
    color: #1f2937;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 0.25rem;
    font-size: 0.95rem; /* enlaces un poco más pequeños como en catálogo */
}

.menu-movil a:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Iconos en enlaces del menú móvil: más pequeños, alineados */
.menu-movil a img {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Botón de perfil móvil junto al menú (inyectado por JS) */
.btn-perfil-mobile {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}
.btn-perfil-mobile:hover { background: #fef2f2; transform: scale(1.06); }
.btn-perfil-mobile img { width: 24px; height: 24px; display: block; }

/* Mostrar y alinear solo en pantallas <= 1024px */
@media (max-width: 1024px) {
  /* Forzar visibilidad/ocultación global en móvil para TODAS las vistas */
  .nav-links { display: none !important; }
  .menu-movil {
      display: inline-flex !important;
      align-items: center !important;
      flex-direction: row !important;
      gap: 4px !important;
      position: relative !important;
      white-space: nowrap !important;
      gap: 4px;
      position: relative;
      white-space: nowrap;
  }
  .menu-movil > button,
  .menu-movil > .btn-perfil-mobile {
      margin: 0;
      padding: 0.5rem;
      position: static;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      vertical-align: middle;
  }
  .menu-movil > button img,
  .menu-movil > .btn-perfil-mobile img { display: block; }
  .btn-perfil-mobile { display: inline-flex; align-items: center; justify-content: center; margin-right: 0.25rem; }
}

/* Botón rojo para Cerrar Sesión / Iniciar Sesión en el menú móvil */
.btn-logout-movil,
.btn-iniciar-sesion-movil {
    background: #dc2626 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.75rem 1rem; /* botón más cómodo */
    margin: 0.5rem 0.25rem 0.25rem; /* aire alrededor para que no quede al límite */
}

/* Main Content */

main {
    min-height: calc(100vh - 200px);
    
}

/* Hero Section */
.img-content {
    height: 550px;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(185, 28, 28, 0.068)), 
                url('https://images.unsplash.com/photo-1481627834876-b7833e8f5570?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80') no-repeat center center/cover;
    color: #ffffff;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}



.textos {
    
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    color: #ffffff;
    font-weight: 900;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    text-align: center;
}

.textos h1 {
    flex: 1;
    
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    
    padding: 1rem;
    border-radius: 12px;
    
}

.textos p {
    flex: 1;
    
    font-size: 1.25rem;
    margin-bottom: 0;
    
    
    padding: 1rem;
    border-radius: 12px;
    
}


.btn-agregar-libro {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    color: #dc2626;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transition: all 0.3s ease;
}

.btn-agregar-libro:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    background: #f3f4f6;
}

/* Flecha decorativa en hero */
.arrow {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.arrow img {
    width: 40px;
    height: 40px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.arrow:hover img {
    opacity: 1;
    transform: scale(1.2);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Main Content */
.main-content {
    padding: 4rem 2rem;
    background: #ffffff;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
}

.filter-navigation {
    text-align: center;
    margin-bottom: 3rem;
}

.filter-navigation h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-tab {
    background: #f3f4f6;
    color: #4b5563;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.filter-tab:hover {
    background: #fef2f2;
    color: #dc2626;
    transform: translateY(-2px);
}



/* Filter Sections */




@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #4b5563;
    font-size: 1.1rem;
}

/* Grid de libros */
.libros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.libro-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #e5e7eb;
}

.libro-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    border-color: #dc2626;
}

.libro-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.libro-imagen {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
}

.libro-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.libro-card:hover .libro-imagen img {
    transform: scale(1.05);
}

.placeholder-imagen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    font-size: 3rem;
}

.libro-info {
    padding: 1.5rem;
}

.libro-titulo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.libro-autor {
    color: #4b5563;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.libro-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.libro-categoria {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.libro-cantidad {
    color: #4b5563;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-favorito {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.btn-favorito button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-favorito button:hover {
    background: #dc2626;
    color: #ffffff;
    transform: scale(1.1);
}

/* Ver más */
.ver-mas-container {
    text-align: center;
    margin-top: 3rem;
}

.btn-ver-mas {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transition: all 0.3s ease;
}

.btn-ver-mas:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    background: linear-gradient(135deg, #b91c1c, #991b1b);
}

/* Footer */
footer {
    background: #1f2937;
    color: #ffffff;
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
}

.logo-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img-footer {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.logo-text-footer span {
    font-size: 1.1rem;
    font-weight: 700;
    color: #dc2626;
    display: block;
}

.logo-text-footer p {
    font-size: 0.9rem;
    color: #d1d5db;
    margin: 0;
}

.social-media {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-media a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #4b5563;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-media a:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.social-media img {
    width: 20px;
    height: 20px;
    
}

.footer-content p {
    text-align: right;
    color: #d1d5db;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .menu-movil {
        display: flex;
    }
    
    .search-container {
        margin: 1rem 0;
        order: 3;
        flex-basis: 100%;
    }
    
    .modal-content-perfil {
        margin-top: 60px;
        margin-right: 10px;
        max-width: 320px;
        padding: 2rem;
    }
    
    .modal-perfil.active {
        padding: 0.5rem;
    }
    
    .textos h1 {
        font-size: 2rem;
    }
    
    .textos p {
        font-size: 1rem;
    }
    
    .filter-navigation h2 {
        font-size: 2rem;
    }
    
    .filter-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .libros-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-content p {
        text-align: center;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 1rem;
    }
    
    .img-content {
        padding: 2rem 1rem;
    }
    
    .main-content {
        padding: 2rem 1rem;
    }
    
    .libros-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-tab {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

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

.libro-card {
    animation: slideInUp 0.6s ease forwards;
}

.libro-card:nth-child(1) { animation-delay: 0.1s; }
.libro-card:nth-child(2) { animation-delay: 0.2s; }
.libro-card:nth-child(3) { animation-delay: 0.3s; }
.libro-card:nth-child(4) { animation-delay: 0.4s; }
.libro-card:nth-child(5) { animation-delay: 0.5s; }
.libro-card:nth-child(6) { animation-delay: 0.6s; }

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Estados de carga */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible para accesibilidad */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}
.alert {
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 8px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
    max-width: 600px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}
