html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: #0f0f0f;
    color: #0000;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==== MENÚ PRINCIPAL FIJO ARRIBA ==== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #000000;
    z-index: 1000;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    height: var(--nav-h);
    box-sizing: border-box;
    color: #000;
}

.navbar-menu {
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.navbar-menu li {
    margin-right: 1.5rem;
}

.navbar-menu li a {
    color: rgb(0, 0, 0);
    text-decoration: none;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

.navbar-menu li a:hover,
.navbar-menu li a.active {
    color: #000000;
}

/* Estilos de submenu */
.sidebar ul .dropdown {
  position: relative;
  z-index: 1000; /* Asegura que siempre esté por encima de la galería */
}

.sidebar ul .submenu {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
  position: absolute;
  left: 100%; /* hace que se abra a la derecha del menú lateral */
  top: 0;
  background-color: #1a1a1a; /* Fondo oscuro para coherencia con el tema */
  min-width: 200px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.3);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1); /* Borde sutil */
}

.sidebar ul .submenu li a {
  display: block;
  padding: 10px;
  color: #e0e0e0; /* Texto claro para alta legibilidad */
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar ul .submenu li a:hover {
  background-color: #3b3b3b; /* Azul brillante para hover, consistente con otros elementos */
  color: #ffffff; /* Texto blanco en hover para contraste */
}

.sidebar ul .dropdown:hover .submenu {
  display: block;
}

/* ==== CONTENEDOR PRINCIPAL ==== */
.main-wrapper {
    display: flex;
    gap: 0;
    flex: 1;
    padding-top: var(--nav-h);
    min-height: calc(100vh - var(--nav-h));
}

/* ==== SIDEBAR LATERAL ==== */
.sidebar {
    width: 220px;
    background: black;
    color: #ffffff;
    text-align: center;
    margin-top: 0px;
    flex-shrink: 0;
}

.sidebar nav ul {
    list-style: none;
    padding: 20px 0;
    margin: 0;
}

.sidebar nav ul li {
    margin: 1rem 0;
}

.sidebar nav ul li a {
    color: rgb(190, 190, 190);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    display: block;
    transition: all 0.3s ease;
}

.sidebar nav ul li a:hover {
    background-color: rgb(255, 255, 255);
    border-radius: 4px;
    color: #a0a0a0;
}

/* ==== GALERÍA ==== */
.gallery-container {
    flex: 1;
    max-width: 100%;
    padding: 20px 0 20px 20px;
    width: 100%;
}

h1 {
    color: #000;
    margin: 0 0 30px;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: 0.5px;
    text-align: center;
}

h2 {
    color: #000;
    margin: 0 0 30px;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 0.5px;
    text-align: center;
}

/* ==== GALERÍA MASONRY LAYOUT ==== */
.gallery-grid {
    column-count: 3;
    column-gap: 20px;
    padding-right: 0;
}

.gallery-item {
    display: inline-block;
    width: 100%;
    margin: 0 0 20px;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    position: relative;
}

.gallery-grid img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    background: #151515;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    cursor: pointer;
}

.gallery-grid img:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    filter: saturate(1.1) brightness(1.05);
}

/* ==== LIGHTBOX ==== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    flex-direction: column;
}

.lightbox img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.close {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 5px 12px;
    transition: 0.3s;
}

.close:hover {
    background: rgb(0, 0, 0);
}

.arrow {
    position: absolute;
    top: 50%;
    font-size: 50px;
    color: #fff;
    cursor: pointer;
    user-select: none;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    transform: translateY(-50%);
    transition: 0.3s;
}

.arrow.left {
    left: 30px;
}

.arrow.right {
    right: 30px;
}

.arrow:hover {
    background: rgb(0, 0, 0);
}

/* Lupa sobre miniaturas (SVG blanco/negro) */
.zoom-icon {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    padding: 8px;
    border-radius: 999px;
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.25s ease;
    pointer-events: none;
}

.zoom-icon svg {
    width: 20px;
    height: 20px;
    display: block;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gallery-item:hover .zoom-icon {
    opacity: 1;
    transform: translateY(0);
    background: #fff;
    border-color: transparent;
}

.gallery-item:hover .zoom-icon svg {
    stroke: #000;
}

/* Lightbox: escenario para pan/zoom y barra de herramientas */
.lb-stage {
    position: relative;
    width: 90vw;
    height: 80vh;
    max-width: 1400px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 100%;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.05s linear;
    will-change: transform;
}

.lb-toolbar {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 4000;
    background: rgba(0,0,0,0.45);
    border-radius: 999px;
    padding: 6px;
    backdrop-filter: blur(4px);
}

.lb-btn {
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.lb-btn:hover {
    background: rgba(255,255,255,0.15);
}

.lb-btn:active {
    transform: scale(0.96);
}

/* ==== RESPONSIVE DESIGN ==== */

/* Tablets y pantallas medianas */
@media (max-width: 1200px) {
    .gallery-grid {
    column-count: 2;
    column-gap: 18px;
    }

    h1 {
    font-size: 2.2rem;
    }
}

/* Tablets pequeñas y móviles grandes */
@media (max-width: 900px) {
    .main-wrapper {
    flex-direction: column;
    gap: 0;
    padding-top: var(--nav-h);
    }

    .sidebar {
    width: 100%;
    background: rgba(34, 34, 34, 0.8);
    backdrop-filter: blur(10px);
    }

    .sidebar nav ul {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 20px;
    scrollbar-width: thin;
    }

    .sidebar nav ul li {
    margin: 0;
    flex: 0 0 auto;
    }

    .sidebar nav ul li a {
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    }

    .gallery-grid {
    column-count: 2;
    column-gap: 15px;
    }

    h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    }
}

/* Móviles */
@media (max-width: 600px) {
    .gallery-container {
    padding: 15px;
    }

    .gallery-grid {
    column-count: 1;
    column-gap: 12px;
    }

    h1 {
    font-size: 1.8rem;
    text-align: center;
    }

    .navbar-menu {
    flex-wrap: wrap;
    gap: 10px;
    }

    .navbar-menu li {
    margin-right: 0;
    }

    .lightbox img {
    max-width: 95%;
    max-height: 85%;
    }

    .arrow {
    font-size: 40px;
    padding: 15px;
    }

    .arrow.left {
    left: 15px;
    }

    .arrow.right {
    right: 15px;
    }

    .lb-stage {
    width: 94vw;
    height: 72vh;
    }

    .lb-toolbar {
    top: 10px;
    gap: 6px;
    }

    .lb-btn {
    padding: 6px 8px;
    font-size: 13px;
    }
}

/* Móviles muy pequeños */
@media (max-width: 480px) {
    .gallery-container {
    padding: 10px;
    }

    .gallery-grid {
    gap: 10px;
    }

    h1 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    }

    .sidebar nav ul {
    padding: 8px 10px;
    }
}

/* Opcional: en móviles muestra siempre la lupa (sin hover) */
@media (hover: none) and (pointer: coarse) {
    .zoom-icon {
    opacity: 1;
    transform: none;
    }
}

/* ==== FOOTER ==== */
footer {
    background: linear-gradient(90deg, #0000 0%, #242424 50%, #0000 100%);
    padding: 36px 0 18px 0;
    text-align: center;
    width: 100%;
    margin-top: auto;
    position: static;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 0 18px;
}

.footer-redes {
    display: flex;
    gap: 18px;
    margin-bottom: 0;
}

.footer-icon {
    width: 38px;
    height: 38px;
    transition: all 0.3s;
    filter: brightness(0.8);
}

.footer-icon:hover {
    transform: scale(1.18);
    filter: brightness(1) drop-shadow(0 0 10px #ffff);
}

.footer-links {
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 1rem;
}

.footer-links a {
    color: #ffff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #ffff;
    text-shadow: 0 0 5px #ffff;
}

.footer-separator {
    color: #ffff;
    opacity: 0.5;
    font-size: 1.2em;
}

.footer-libro .libro-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #ffff;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s;
}

.footer-libro .libro-btn img {
    width: 38px;
    height: 38px;
}

.footer-libro .libro-btn:hover,
.footer-libro .libro-btn:focus {
    color: #ffff;
}

.footer-copyright {
    color: #ffff;
    font-size: 0.95em;
    margin-top: 10px;
}

/* ==== MODAL LIBRO DE RECLAMACIONES ==== */
.modal-libro {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-contenido {
    background: linear-gradient(90deg, #0000 0%, #242424 50%, #0000 100%);
    margin: 5% auto;
    padding: 32px 18px;
    border: 2px solid transparent;
    border-radius: 18px;
    width: 95%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-contenido h2 {
    color: #ffff;
    text-align: center;
    margin-bottom: 18px;
    text-shadow: 0 0 10px #ffff;
}

.libro-info {
    color: #a0d6ff;
    text-align: center;
    margin-bottom: 24px;
}

.libro-formulario {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.libro-formulario label {
    color: #ffff;
    font-weight: 500;
}

.libro-formulario input,
.libro-formulario select,
.libro-formulario textarea {
    padding: 10px;
    background: rgba(0, 26, 0, 0.8);
    border: 2px solid #ffff;
    border-radius: 8px;
    color: #a0d6ff;
    font-family: 'Inter', sans-serif;
}

.libro-formulario button {
    background: linear-gradient(90deg, #0000 0%, #242424 50%, #0000 100%);
    color: #ffff;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.libro-formulario button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.18);
}

.cerrar-modal {
    color: #ffff;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.cerrar-modal:hover {
    color: #fff;
    text-shadow: 0 0 10px #ffff;
}

/* Overlay del modal oculto por defecto */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

/* Cuando está abierto */
.modal.is-open {
  display: flex;
}

/* Contenedor interno */
.modal__content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  background: transparent;
}

/* Imagen dentro del modal */
.modal__img {
  max-width: 90vw;
  max-height: 90vh;
  transform-origin: center center;
  transition: transform 0.1s ease-out;
  user-select: none;
  pointer-events: none;
}

/* Botón cerrar y controles */
.modal__close {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff; border: 0;
  padding: 6px 10px; border-radius: 4px;
  cursor: pointer; font-size: 16px;
  z-index: 1;
}

.zoom-controls {
  position: absolute;
  bottom: 10px; right: 10px;
  display: flex; gap: 8px;
  z-index: 1;
}

.zoom-controls button {
  background: rgba(0,0,0,0.6);
  color: #fff; border: 0;
  padding: 6px 10px; border-radius: 4px;
  cursor: pointer; font-size: 14px;
}

.zoom-icon {
  display: none !important;
}