/* =========================================================
   COQUETINA — Estilos del front
   Todos los colores provienen de variables definidas en
   includes/header.php y administrables desde el panel.
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente-texto);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 300;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primario); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--fuente-titulos);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: .01em;
}
h1 { font-size: clamp(2.2rem, 5.6vw, 3.6rem); }
h2 { font-size: clamp(1.85rem, 4vw, 2.7rem); }
h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
p  { margin: 0 0 1em; max-width: 70ch; }

:focus-visible {
  outline: 3px solid var(--secundario);
  outline-offset: 3px;
}

.saltar {
  position: absolute; left: -9999px; top: 0;
  background: var(--primario); color: #fff; padding: 10px 16px; z-index: 999;
}
.saltar:focus { left: 8px; top: 8px; }

.contenedor {
  width: min(1180px, 100% - 40px);
  margin-inline: auto;
}

.centrado { text-align: center; margin-top: 34px; }
.vacio { text-align: center; opacity: .7; padding: 40px 0; }

/* ---------------- Botones ---------------- */
.boton {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 999px;
  font-family: var(--fuente-texto);
  font-size: .98rem;
  font-weight: 500;
  letter-spacing: .02em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.boton:hover { text-decoration: none; transform: translateY(-2px); }
.boton-primario {
  background: var(--primario);
  color: var(--claro);
  box-shadow: 0 10px 24px -12px rgba(0,0,0,.55);
}
.boton-primario:hover { box-shadow: 0 16px 30px -14px rgba(0,0,0,.6); }
.boton-borde {
  background: transparent;
  border-color: var(--primario);
  color: var(--primario);
}
.boton-borde:hover { background: var(--primario); color: var(--claro); }
.boton-ancho { width: 100%; }

/* ---------------- Cabecera ---------------- */
.cabecera {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--header-fondo);
  color: var(--header-texto);
  border-bottom: 1px solid rgba(0,0,0,.07);
  padding-top: env(safe-area-inset-top, 0px);
}
.cabecera.encogido { box-shadow: 0 8px 24px -18px rgba(0,0,0,.6); }

.cabecera-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding-block: 10px;
}
.marca { display: inline-flex; align-items: center; }
.marca img { width: var(--logo-ancho); max-width: 60vw; height: auto; }
.marca-texto {
  font-family: var(--fuente-titulos);
  font-size: 1.9rem;
  color: var(--primario);
  letter-spacing: .02em;
}

.menu ul {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.menu a {
  color: var(--header-texto);
  font-size: .96rem;
  font-weight: 400;
  padding: 6px 0;
  position: relative;
}
.menu a:hover { text-decoration: none; color: var(--primario); }
.menu a:not(.boton)::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px; background: var(--primario);
  transition: width .25s ease;
}
.menu a:not(.boton):hover::after,
.menu a.activo::after { width: 100%; }
.menu .boton { color: var(--claro); }

.menu-boton {
  display: none;
  width: 46px; height: 42px;
  background: transparent;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 12px;
  cursor: pointer;
  padding: 10px 9px;
}
.menu-boton span {
  display: block; height: 2px; background: var(--header-texto);
  border-radius: 2px; transition: transform .25s ease, opacity .2s ease;
}
.menu-boton span + span { margin-top: 5px; }
.menu-boton[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-boton[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-boton[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------- Hero / carrusel ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--oscuro);
  touch-action: pan-y;
}
.hero-pista {
  display: flex;
  cursor: grab;
  transition: transform .55s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
.hero-pista.arrastrando { cursor: grabbing; transition: none; }
.hero-slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 100%;
}
.hero-slide img {
  width: 100%;
  height: var(--hero-alto);
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}

.hero-texto {
  position: absolute;
  inset: 0;
  display: flex;
  padding: clamp(24px, 5vw, 70px);
  pointer-events: none;
}
.hero-texto-caja { max-width: 640px; pointer-events: auto; }
.hero-texto h1 { color: inherit; margin-bottom: .3em; text-shadow: 0 2px 18px rgba(0,0,0,.4); }
.hero-texto p {
  color: inherit;
  font-size: clamp(1rem, 2vw, 1.25rem);
  text-shadow: 0 2px 14px rgba(0,0,0,.45);
  margin-bottom: 1.4em;
}
.hero-centro  { align-items: center; justify-content: center; text-align: center; }
.hero-izquierda { align-items: center; justify-content: flex-start; text-align: left; }
.hero-derecha { align-items: center; justify-content: flex-end; text-align: right; }
.hero-abajo   { align-items: flex-end; justify-content: center; text-align: center; }

.hero-flecha {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.82);
  color: var(--oscuro);
  font-size: 18px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s ease;
}
.hero-flecha:hover { background: #fff; }
.hero-flecha-prev { left: 18px; }
.hero-flecha-sig  { right: 18px; }

.hero-puntos {
  position: absolute;
  left: 0; right: 0; bottom: 16px;
  display: flex; justify-content: center; gap: 9px;
}
.hero-punto {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  padding: 0;
}
.hero-punto.activo { background: #fff; width: 26px; border-radius: 999px; }

/* ---------------- Secciones ---------------- */
.seccion { padding: clamp(56px, 8vw, 104px) 0; }
.seccion-cabecera { max-width: 720px; margin: 0 auto 46px; text-align: center; }
.seccion-cabecera p { margin-inline: auto; opacity: .78; }

.encabezado-pagina {
  background: var(--oscuro);
  color: var(--claro);
  padding: clamp(50px, 8vw, 92px) 0 clamp(40px, 6vw, 70px);
}
.encabezado-pagina h1 { color: var(--claro); margin-bottom: .2em; }
.encabezado-pagina p { opacity: .82; }

/* ---------------- Servicios ---------------- */
.servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 22px;
}
.servicio-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 330px;
  padding: 26px;
  border-radius: var(--radio);
  overflow: hidden;
  background-color: var(--oscuro);
  background-size: cover;
  background-position: center;
  color: #fff;
  transition: transform .3s ease, box-shadow .3s ease;
}
a.servicio-card:hover { text-decoration: none; transform: translateY(-4px); box-shadow: 0 22px 40px -26px rgba(0,0,0,.8); }
.servicio-card-sin-img {
  background-image: none;
  background: linear-gradient(160deg, var(--primario), var(--oscuro));
}
.servicio-contenido { position: relative; z-index: 2; }
.servicio-icono { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.servicio-card h3 { color: #fff; margin-bottom: .3em; }
.servicio-card p { color: rgba(255,255,255,.88); font-size: .95rem; margin: 0; }

/* ---------------- Galería ---------------- */
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.galeria-item {
  position: relative;
  margin: 0;
  border-radius: var(--radio);
  overflow: hidden;
  background: #efe6e3;
  cursor: zoom-in;
}
.galeria-item img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform .5s ease;
}
.galeria-item:hover img { transform: scale(1.05); }
.galeria-item figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 14px 12px;
  font-size: .88rem;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.72));
}

.filtros { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 32px; }
.filtro {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.14);
  color: var(--texto);
  font-size: .92rem;
}
.filtro:hover { text-decoration: none; border-color: var(--primario); color: var(--primario); }
.filtro-activo { background: var(--primario); border-color: var(--primario); color: #fff; }

/* ---------------- Quiénes somos ---------------- */
.seccion-nosotros { background: var(--claro); }
.nosotros-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.nosotros-subtitulo {
  font-family: var(--fuente-titulos);
  font-size: 1.4rem;
  color: var(--primario);
  margin-bottom: 1em;
}
.nosotros-img img {
  width: 100%;
  border-radius: var(--radio);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.nosotros-datos {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin: 30px 0 0;
  padding-top: 26px;
  border-top: 1px solid rgba(0,0,0,.1);
}
.nosotros-datos dt {
  font-family: var(--fuente-titulos);
  font-size: 2rem;
  color: var(--primario);
  line-height: 1;
}
.nosotros-datos dd { margin: 4px 0 0; font-size: .9rem; opacity: .75; }

/* ---------------- Contacto ---------------- */
.seccion-contacto { background: var(--fondo); }
.contacto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(26px, 4vw, 54px);
  align-items: start;
}
.contacto-bajada { opacity: .8; }
.contacto-lista { list-style: none; padding: 0; margin: 26px 0; }
.contacto-lista li { padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,.08); font-size: .97rem; }
.contacto-lista span {
  display: block;
  font-size: .78rem;
  letter-spacing: .06em;
  opacity: .6;
  margin-bottom: 2px;
}
.mapa { border-radius: var(--radio); overflow: hidden; margin-top: 8px; }
.mapa iframe { width: 100%; min-height: 260px; border: 0; display: block; }

.contacto-form-caja {
  background: var(--claro);
  border-radius: var(--radio);
  padding: clamp(22px, 3vw, 36px);
  box-shadow: 0 24px 50px -34px rgba(0,0,0,.5);
}
.campo { margin-bottom: 16px; }
.campo-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.campo label {
  display: block;
  font-size: .85rem;
  margin-bottom: 6px;
  opacity: .8;
}
.campo input, .campo select, .campo textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid rgba(0,0,0,.16);
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--texto);
  background: #fff;
}
.campo textarea { resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none;
  border-color: var(--primario);
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.aviso-ok {
  background: #e8f6ed;
  border: 1px solid #bfe3cc;
  color: #1c6b41;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: .94rem;
}

/* ---------------- Pie ---------------- */
.pie {
  background: var(--footer-fondo);
  color: var(--footer-texto);
  padding-top: clamp(44px, 6vw, 70px);
}
.pie a { color: var(--footer-texto); opacity: .85; }
.pie a:hover { opacity: 1; }
.pie-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 34px;
  padding-bottom: 40px;
}
.pie h3 { font-size: 1.15rem; color: var(--footer-texto); margin-bottom: .7em; }
.pie-logo { width: var(--logo-ancho); max-width: 70%; margin-bottom: 14px; }
.pie-marca { font-family: var(--fuente-titulos); font-size: 1.7rem; margin: 0 0 10px; }
.pie-texto { font-size: .95rem; opacity: .82; }
.pie-lista { list-style: none; padding: 0; margin: 0; }
.pie-lista li { padding: 5px 0; font-size: .94rem; opacity: .9; }
.pie-horario { white-space: pre-line; }
.pie-redes { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; font-size: .9rem; }
.pie-base { border-top: 1px solid rgba(255,255,255,.14); padding: 18px 0; }
.pie-base-fila {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  font-size: .85rem;
  opacity: .78;
}

/* ---------------- WhatsApp flotante ---------------- */
.wa-flotante {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 140;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 12px 26px -10px rgba(0,0,0,.5);
}
.wa-flotante:hover { text-decoration: none; transform: scale(1.05); }

/* ---------------- Pop up ---------------- */
.popup-fondo {
  position: fixed;
  inset: 0;
  background: rgba(20,10,16,.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}
.popup-fondo.abierto { display: flex; }
.popup {
  position: relative;
  background: var(--claro);
  border-radius: var(--radio);
  max-width: 460px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  overscroll-behavior: contain;
}
.popup-img { width: 100%; display: block; }
.popup-cuerpo { padding: 24px; text-align: center; }
.popup-cuerpo h3 { color: var(--primario); }
.popup-cuerpo p { margin-inline: auto; font-size: .97rem; }
.popup-cerrar {
  position: absolute;
  top: 10px; right: 10px;
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: var(--texto);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

/* ---------------- Lightbox ---------------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(12,6,10,.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 210;
  padding: 40px 16px;
}
.lightbox.abierto { display: flex; }
.lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 10px; }
.lightbox-cerrar, .lightbox-nav {
  position: absolute;
  background: rgba(255,255,255,.14);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  width: 46px; height: 46px;
  font-size: 20px;
}
.lightbox-cerrar { top: 20px; right: 20px; font-size: 26px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-sig  { right: 16px; top: 50%; transform: translateY(-50%); }

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1024px) {
  .pie-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .nosotros-grid,
  .contacto-grid { grid-template-columns: 1fr; }
  .nosotros-img { order: -1; }
}

@media (max-width: 860px) {
  .menu-boton { display: block; }
  .menu {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(320px, 86vw);
    background: var(--header-fondo);
    padding: 96px 26px 40px;
    transform: translateX(105%);
    transition: transform .3s ease;
    box-shadow: -20px 0 50px -30px rgba(0,0,0,.8);
    overflow-y: auto;
    z-index: 130;
  }
  .menu.abierto { transform: translateX(0); }
  .menu ul { flex-direction: column; align-items: flex-start; gap: 4px; }
  .menu li { width: 100%; }
  .menu a { display: block; width: 100%; padding: 13px 0; font-size: 1.05rem; border-bottom: 1px solid rgba(0,0,0,.07); }
  .menu .boton { margin-top: 16px; text-align: center; border-bottom: none; }
  body.menu-abierto { overflow: hidden; }
}

@media (max-width: 767px) {
  body { font-size: 16px; }
  .contenedor { width: min(100% - 32px, 100%); }

  /* La portada se ve completa en móvil: sin recorte ni scroll lateral */
  .hero-slide img {
    height: auto;
    max-height: none;
    object-fit: contain;
    background: var(--oscuro);
  }
  .hero-texto {
    position: static;
    inset: auto;
    background: var(--oscuro);
    color: var(--claro) !important;
    padding: 22px 18px 28px;
    text-align: center;
    justify-content: center;
  }
  .hero-texto-caja { max-width: 100%; }
  .hero-texto h1 { font-size: 1.75rem; text-shadow: none; }
  .hero-texto p { font-size: 1rem; text-shadow: none; }
  .hero-flecha { width: 38px; height: 38px; font-size: 15px; }
  .hero-flecha-prev { left: 8px; }
  .hero-flecha-sig { right: 8px; }
  .hero-puntos { bottom: 10px; }

  .servicios-grid { grid-template-columns: 1fr; }
  .servicio-card { min-height: 260px; }
  .galeria-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .campo-fila { grid-template-columns: 1fr; gap: 0; }
  .pie-grid { grid-template-columns: 1fr; text-align: left; }
  .nosotros-datos { gap: 20px; }
  .nosotros-datos dt { font-size: 1.6rem; }
  .lightbox-nav { width: 40px; height: 40px; }
}

@media (max-width: 520px) {
  .marca img { width: var(--logo-ancho-movil); }
  .galeria-grid { grid-template-columns: 1fr; }
  .galeria-grid-completa { grid-template-columns: repeat(2, 1fr); }
  .boton { padding: 12px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .cabecera, .pie, .wa-flotante, .popup-fondo, .hero-flecha, .hero-puntos { display: none !important; }
}
