:root {
  --primary: #f26132;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100svh;
  background-image: url('../img/hero-bg.avif');
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.hero-gradient-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: linear-gradient(to bottom, transparent, #000000);
  pointer-events: none;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  letter-spacing: 0.1em;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: #e0e0e0;
}

.hero-script {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: #ffffff;
}

/* Subtítulo script reutilizable */
.script-subtitle {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: #ffffff;
  font-weight: 400;
}

/* Nosotros */
#nosotros img {
  display: block;
}

/* Navbar */
.navbar-transparent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: transparent !important;
}

.navbar .nav-link:hover {
  color: var(--primary) !important;
  transition: color 0.2s ease;
}

@media (max-width: 991px) {
  .navbar-transparent #navMenu {
    background-color: #000000;
    border-top: 1px solid #222;
    padding: 0.5rem 1rem 1rem;
  }
}

/* Scroll to top */
#scrollTopBtn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  width: 44px;
  height: 44px;
  background: rgba(242, 97, 50, 0.75);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

#scrollTopBtn.visible {
  opacity: 1;
  pointer-events: auto;
}

#scrollTopBtn:hover {
  transform: translateY(-3px);
  background: #ff8c5a;
}

/* Espacio — background top en móvil */
@media (max-width: 767px) {
  .seccion-espacio {
    background-position: top center !important;
  }
}

/* =====================
   Carta — PDF Viewer
   ===================== */

/* Sección exactamente 100vh, nada se desborda */
.carta-section {
  background-color: #111111;
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Heading compacto — solo consume el offset del navbar + texto */
.carta-heading {
  padding-top: 90px;
  padding-bottom: 10px;
  flex-shrink: 0;
  text-align: center;
}

/* Viewer: flex:1 → ocupa TODA la altura restante */
.carta-pdf-viewer {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;  /* sidebar izquierda + doc derecha */
}

/* ── Sidebar izquierda: thumbnails ── */
.carta-sidebar {
  width: 90px;
  flex-shrink: 0;
  background: #000000;
  border-right: 1px solid #222;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  scrollbar-width: thin;
  scrollbar-color: #f26132 #1a1a1a;
}

.carta-sidebar::-webkit-scrollbar       { width: 3px; }
.carta-sidebar::-webkit-scrollbar-track { background: #1a1a1a; }
.carta-sidebar::-webkit-scrollbar-thumb { background: #f26132; border-radius: 2px; }

.carta-sidebar-thumb {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 2px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}

.carta-sidebar-thumb.active {
  border-color: #f26132;
  background: rgba(242, 97, 50, 0.07);
}

.carta-sidebar-thumb:hover:not(.active) {
  border-color: rgba(242, 97, 50, 0.35);
}

.carta-sidebar-thumb img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.55;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s;
}

.carta-sidebar-thumb.active img,
.carta-sidebar-thumb:hover img { opacity: 1; }

.carta-page-num {
  color: #555;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

.carta-sidebar-thumb.active .carta-page-num { color: #f26132; }

/* ── Área del documento: flex:1, posición relativa para las flechas ── */
.carta-doc-area {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0;      /* flechas como overlay sobre la imagen */
  overflow: hidden;
}

/* La página — flota con sombra de documento */
.carta-doc-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow:
    0 2px 8px  rgba(0, 0, 0, 0.55),
    0 16px 48px rgba(0, 0, 0, 0.75);
  transition: opacity 0.18s ease;
}

/* Flechas: position absolute, centro vertical del área */
.carta-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 52px;
  height: 64px;
  background: transparent;
  border: none;
  color: #f26132;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  -webkit-text-stroke: 1.5px currentColor;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.carta-nav-btn:hover { color: #ff8c5a; }

.carta-nav-prev { left: 10px; }
.carta-nav-next { right: 10px; }

/* Contador sutil, esquina inferior central */
.carta-doc-counter {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: #444;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  pointer-events: none;
  white-space: nowrap;
}

/* ── Móvil: sidebar pasa a tira horizontal debajo ── */
@media (max-width: 767px) {
  .carta-section {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  .carta-pdf-viewer {
    flex-direction: column-reverse;
    flex: none;
  }

  /* Imagen con altura fija */
  .carta-doc-area {
    height: 58vh;
    padding: 12px 0;
  }

  /* Sidebar debajo, horizontal */
  .carta-sidebar {
    width: 100%;
    height: 96px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-top: 1px solid #222;
    padding: 8px 10px;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: #f26132 #1a1a1a;
  }

  .carta-sidebar::-webkit-scrollbar        { height: 3px; }
  .carta-sidebar::-webkit-scrollbar-track  { background: #1a1a1a; }
  .carta-sidebar::-webkit-scrollbar-thumb  { background: #f26132; }

  .carta-sidebar-thumb {
    flex-shrink: 0;
    width: 52px;
  }

  .carta-sidebar-thumb img {
    width: 52px;
    height: 70px;
    object-fit: cover;
  }
}

/* ── Zoom lightbox (desktop only) ── */
@media (min-width: 768px) {
  .carta-doc-img { cursor: zoom-in; }
}


#cartaZoomOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(0, 0, 0, 0.90);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

#cartaZoomOverlay.open { display: flex; }

#cartaZoomOverlay img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.8);
  cursor: default;
  animation: cartaZoomIn 0.18s ease;
}

@keyframes cartaZoomIn {
  from { transform: scale(0.93); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

#cartaZoomClose {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  z-index: 1;
}

#cartaZoomClose:hover { opacity: 1; }
