/* ── VARIABLES ── */
:root {
  --azul-oscuro:   #0c447c;
  --azul-medio:    #185fa5;
  --azul-claro:    #378add;
  --azul-palido:   #e6f1fb;
  --verde-agua:    #1d9e75;
  --verde-palido:  #e1f5ee;
  --fondo:         #F0F8FF;
  --blanco:        #ffffff;
  --texto:         #1a2940;
  --texto-suave:   #4a6080;
  --dorado:        #ba7517;
  --dorado-palido: #faeeda;
  --morado:        #534ab7;
  --morado-palido: #eeedfe;
  --primary-color: #1E90FF;
    --secondary-color: #2e6be6;
    --background-color: #F0F8FF;
    --text-color: #ffffff;
    --navbar-height: rgba(28, 112, 186, 0.656);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { background-color: var(--background-color); font-family: 'Lato', sans-serif; }

/* ── NAV ── */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--navbar-height);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 10px 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    height: 80px;
}

.logo-container .logo {
    height: 80px;
    width: auto;
}

.nav-center {
    display: flex;
    flex-grow: 1;
    justify-content: flex-end;
}

.nav-bottom ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-bottom ul li a {
    text-decoration: none;
    font-family: 'Trebuchet MS', cursive;
    font-size: 20px;
    color: var(--background-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.nav-bottom ul li a:hover,
.nav-bottom ul li a.active { color: #a8d4ff; transform: scale(1.10); }
/* ── HERO ── */
.doc-hero {
    position: relative;
    padding: 70px 20px 90px;
    text-align: center;
    overflow: hidden;
}

.doc-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("../img/imagen(10).png") center/cover no-repeat;
    z-index: 0;
}

/* Capa oscura sobre la foto */
.doc-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(8, 30, 60, 0.45) 0%,
        rgba(8, 30, 60, 0.65) 50%,
        rgba(8, 30, 60, 0.30) 100%
    );
    z-index: 1;
}

.doc-hero .wave {
    position: absolute;
    bottom: -1px; left: 0;
    width: 100%; z-index: 3; line-height: 0;
}
.doc-hero .wave svg { display: block; width: 100%; }

.doc-hero-content {
    position: relative;
    z-index: 4;
    animation: fadeUp 0.9s ease both;
}

.doc-hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    color: #d6ecff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    padding: 5px 18px;
    border-radius: 20px;
    margin-bottom: 18px;
    border: 1px solid rgba(255,255,255,0.25);
}

.doc-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: #fff;
    text-shadow: 0 2px 16px rgba(0,0,0,0.5);
    margin-bottom: 12px;
}

.doc-hero p {
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: rgba(255,255,255,0.88);
    font-style: italic;
    text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

.doc-hero-divider {
    width: 60px; height: 2px;
    background: rgba(255,255,255,0.5);
    margin: 16px auto;
    border-radius: 2px;
}
/* ── GALERÍA ── */
.galeria-section {
    padding: 60px 40px 80px;
    max-width: 1100px;
    margin: 0 auto;
}

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Última imagen centrada si es impar */
.galeria-grid .galeria-item:last-child:nth-child(3n - 2) {
    grid-column: 1 / -1;
    max-width: 360px;
    margin: 0 auto;
    width: 100%;
}

.galeria-item {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 3 / 4;
    background: #dce8f5;
    box-shadow: 0 4px 16px rgba(30,144,255,0.1);
    border: 1px solid rgba(30,144,255,0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.galeria-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(30,144,255,0.2);
}
.galeria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.galeria-item:hover img { transform: scale(1.04); }

.galeria-overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 68, 124, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.galeria-overlay i {
    font-size: 2.2rem;
    color: transparent;
    -webkit-text-stroke: 1.5px #ffffff;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}
.galeria-item:hover .galeria-overlay { opacity: 1; }
.galeria-overlay span { font-size: 2.2rem; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3)); }

/* ── LIGHTBOX ── */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.lightbox.abierto { display: flex; }

.lb-img {
    max-width: 90vw;
    max-height: 82vh;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    object-fit: contain;
    animation: fadeUp 0.3s ease;
}

.lb-cerrar {
    position: absolute;
    top: 20px; right: 28px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.lb-cerrar:hover { opacity: 1; }

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 2.4rem;
    width: 52px; height: 52px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.lb-nav:hover { background: rgba(255,255,255,0.2); }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }

.lb-counter {
    position: absolute;
    bottom: 24px;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    letter-spacing: 1px;
}

/* ── FOOTER ── */
.ft {
    background: #0c447c;
    color: #b5d4f4;
    font-size: 14px;
    padding: 56px 40px 0;
}
.ft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto 48px;
}
.ft-col h4 { color: #fff; font-size: 15px; font-weight: 500; margin: 0 0 16px; }
.ft-logo { font-size: 18px; font-weight: 500; color: #fff; margin: 0 0 10px; }
.ft-tagline { color: #85b7eb; font-size: 13px; line-height: 1.6; margin: 0 0 20px; }
.ft-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ft-col ul li a { color: #b5d4f4; text-decoration: none; font-size: 14px; transition: color 0.2s; }
.ft-col ul li a:hover { color: #fff; }
.ft-contact-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; color: #b5d4f4; font-size: 14px; }
.ft-divider { border: none; border-top: 1px solid rgba(133,183,235,0.2); margin: 0; }
.ft-bottom {
    max-width: 1100px; margin: 0 auto;
    padding: 20px 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    font-size: 12px; color: #85b7eb;
}
.ft-badge {
    background: rgba(133,183,235,0.12);
    color: #85b7eb;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    border: 1px solid rgba(133,183,235,0.25);
}

/* ── ANIMACIÓN ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .galeria-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .galeria-section { padding: 40px 20px 60px; }
    .galeria-grid .galeria-item:last-child:nth-child(3n - 2) {
        grid-column: auto;
        max-width: 100%;
    }
    .lb-prev { left: 10px; }
    .lb-next { right: 10px; }
}
@media (max-width: 480px) {
    nav { padding: 10px 16px; }
    .nav-bottom ul { gap: 14px; }
    .nav-bottom ul li a { font-size: 15px; }
    .galeria-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

#loader {
  position: fixed;
  inset: 0;
  background: #0c447c;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.5s ease;
}
.loader-logo-ring {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.loader-logo-ring img { width: 90px; height: auto; }
.loader-title {
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  margin: 0;
}
.loader-sub {
  color: rgba(181,212,244,0.75);
  font-size: 0.9rem;
  font-style: italic;
  margin: -12px 0 0;
}
.loader-bar-wrap {
  width: 200px; height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 99px;
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  background: #1E90FF;
  border-radius: 99px;
  width: 0%;
  transition: width 0.1s linear;
}
.loader-pct {
  color: rgba(181,212,244,0.55);
  font-size: 12px;
  margin-top: -12px;
}

/* ── OFICINA MEDIANA: 1366×768 ── */
@media (max-width: 1366px) and (min-width: 821px) {
  .galeria-section { padding: 60px 32px 80px; }
  .galeria-grid { gap: 18px; }
  nav { padding: 10px 32px; }
}
 
/* ── OFICINA ALTA: 1536×864 ── */
@media (max-width: 1536px) and (min-width: 1367px) {
  .galeria-section { max-width: 1200px; }
  nav { padding: 10px 48px; }
}
 
/* ── OFICINA FULL HD: 1920×1080 (baseline, sin límite superior) ── */
@media (min-width: 1537px) {
  .galeria-section { max-width: 1280px; padding: 70px 40px 100px; }
  nav { padding: 10px 60px; }
  .nav-bottom ul { gap: 40px; }
  .nav-bottom ul li a { font-size: 21px; }
}
 
/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .doc-hero-content,
  .lb-img { animation: none; }
  .galeria-item,
  .galeria-item img { transition: none; }
}

/* ── HAMBURGUESA ── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px;
    z-index: 1100;
}
.hamburger span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.hamburger.abierto span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.abierto span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.abierto span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ── MENÚ MÓVIL ── */
.nav-mobile-menu {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: rgba(12, 68, 124, 0.97);
    backdrop-filter: blur(8px);
    z-index: 999;
    padding: 20px 0 28px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}
.nav-mobile-menu.abierto {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.nav-mobile-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.nav-mobile-menu ul li { width: 100%; text-align: center; }
.nav-mobile-menu ul li a {
    display: block;
    text-decoration: none;
    font-family: 'Trebuchet MS', cursive;
    font-size: 18px;
    color: rgba(255,255,255,0.9);
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    transition: background 0.2s, color 0.2s;
}
.nav-mobile-menu ul li:last-child a { border-bottom: none; }
.nav-mobile-menu ul li a:hover,
.nav-mobile-menu ul li a.active {
    background: rgba(255,255,255,0.08);
    color: #a8d4ff;
}

/* ── Activar hamburguesa a partir de 820px ── */
@media (max-width: 820px) {
    .nav-bottom { display: none; }
    .hamburger  { display: flex; }
}

/* ── Nav altura reducida en móvil pequeño ── */
@media (max-width: 480px) {
    .nav-mobile-menu { top: 70px; }
}
@media (max-width: 360px) {
    .nav-mobile-menu { top: 64px; }
}