﻿/* styles.css */

/* 1. Variables globales */
:root {
  --rojo-rjm:   #E02B20;
  --negro-rjm:  #111111;
  --gris-claro: #F5F5F5;
  --blanco:     #FFFFFF;

  --font-title: 'Montserrat', sans-serif;
  --font-base:  'Open Sans', sans-serif;
}

/* Activar smooth scroll y compensar header fijo */
html {
  scroll-behavior: smooth;      /* desplazamiento suave */
  scroll-padding-top: 70px;     /* evita que el contenido quede oculto tras el header */
}

/* 2. Reset minimal y tipografía */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: var(--font-base);
  color: var(--negro-rjm);
  line-height: 1.6;
  background: var(--blanco);
}

body.no-scroll {
  overflow: hidden;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.gallery-modal.is-open {
  display: flex;
}

.gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}

.gallery-dialog {
  position: relative;
  background: var(--blanco);
  max-width: min(900px, 92vw);
  max-height: 90vh;
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.gallery-modal.is-open .gallery-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.gallery-modal.is-open .gallery-backdrop {
  opacity: 1;
}

.gallery-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  font-size: 2rem;
  line-height: 1;
  color: var(--negro-rjm);
  cursor: pointer;
}

.gallery-dialog-content {
  padding: 2.25rem 2rem;
  overflow-y: auto;
}

.gallery-heading h3 {
  font-family: var(--font-title);
  margin-bottom: 0.5rem;
}

.gallery-heading p {
  margin-bottom: 1.5rem;
  color: #444;
}

.gallery-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.gallery-item {
  margin: 0;
  cursor: zoom-in;
}

.gallery-item:focus-visible {
  outline: 3px solid var(--rojo-rjm);
  outline-offset: 3px;
}

.gallery-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 0.6rem;
}

.gallery-lightbox {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: rgba(0,0,0,0.85);
  padding: 2rem 1.5rem;
  z-index: 10;
}

.gallery-lightbox[hidden] {
  display: none;
}

.lightbox-frame {
  max-width: min(900px, 90%);
  max-height: calc(90vh - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-frame img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-control {
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: var(--blanco);
  font-size: 1.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.3s ease;
}

.lightbox-control:hover,
.lightbox-control:focus-visible {
  background: rgba(255,255,255,0.25);
  transform: translateY(-1px);
  outline: none;
}

.lightbox-control--prev,
.lightbox-control--next {
  flex-shrink: 0;
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  border: none;
  background: transparent;
  color: var(--blanco);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

@media (max-width: 600px) {
  .gallery-dialog-content {
    padding: 1.75rem 1.25rem;
  }
  .gallery-grid img {
    height: 150px;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--reveal-delay, 0s);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 4. Header */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
/*   background: #9491917e; */
/*   border-bottom: 1px solid #ddd; */
  z-index: 1000;
}

.site-header.scrolled {
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(5px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.logo img {
  height: 60px;
}
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}
.main-nav a {
  text-decoration: none;
  color: var(--blanco);
  font-weight: 600;
}
/* Nav móvil (oculto por defecto) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
}

/* 5. Hero / Portada con vídeo de fondo full-screen */
.hero {
  position: relative;          /* para el vídeo absoluto */
  overflow: hidden;
  height: 100vh;               /* ocupa toda la ventana */
  display: flex;
  align-items: center;
  justify-content: center;
  /* eliminada la imagen de fondo */
}
.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);   /* capa semitransparente */
  z-index: -0.5;
}
.hero-content {
  position: relative;          /* sobre el vídeo */
  z-index: 1;
  max-width: 600px;
  text-align: center;          /* centra texto */
  color: var(--blanco);        /* texto blanco */
}
.hero h1 {
  font-family: var(--font-title);
  font-size: 3rem;
  margin-bottom: 1rem;
}
.hero p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

/* 5 bis. Sobre Nosotros */
.about {
  background: #F6F7F9;
  padding: 5rem 0 4rem;
}

.about-wrapper {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem;
  align-items: center;
}

.about-text {
  max-width: 560px;
}

.about-kicker {
  display: inline-block;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--rojo-rjm);
  margin-bottom: 1rem;
}

.about-text h2 {
  font-family: var(--font-title);
  font-size: clamp(2rem, 3.3vw, 2.9rem);
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.about-lead {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #333;
}

.about-media {
  display: flex;
  justify-content: center;
}

.about-text p {
  margin-bottom: 0.85rem;
}

.about-media img {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.stat-card {
  background: var(--blanco);
  border-radius: 0.75rem;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.stat-value {
  display: block;
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--rojo-rjm);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.4;
}

@media (max-width: 960px) {
  .about-wrapper {
    grid-template-columns: 1fr;
  }
  .about-text {
    max-width: none;
  }
  .about-media {
  display: flex;
  justify-content: center;
}
}

@media (max-width: 600px) {
  .about {
    padding: 4rem 0 3rem;
  }
  .about-text {
    text-align: center;
  }
  .about-kicker {
    letter-spacing: 0.12em;
  }
  .about-stats {
    gap: 1rem;
  }
  .stat-card {
    padding: 1.5rem 1.25rem;
  }
}
/* 6. Botones */
.btn-primary {
  display: inline-block;
  background: var(--rojo-rjm);
  color: var(--blanco);
  padding: 0.75rem 1.5rem;
  border-radius: 0.25rem;
  text-decoration: none;
  font-weight: 600;
}
.btn-secondary {
  display: inline-block;
  background: var(--negro-rjm);
  color: var(--blanco);
  padding: 0.75rem 1.5rem;
  border-radius: 0.25rem;
  text-decoration: none;
  font-weight: 600;
}




/* 7. Servicios (layout horizontal) */
.services {
  padding: 5rem 0;
}

.services .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.services h2 {
  text-align: center;
  font-family: var(--font-title);
  margin-bottom: 3rem;
}

.services-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.service-card {
  background: var(--blanco);
  border-radius: 0.85rem;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
}

.service-header {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.service-cover {
  flex: 1 1 45%;
  min-width: 280px;
  min-height: 260px;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.service-summary {
  flex: 1 1 40%;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.service-summary h3 {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 2.5vw, 2.2rem);
}

.service-summary p {
  color: #444;
  font-size: 1rem;
  line-height: 1.6;
}

.service-toggle {
  background: var(--rojo-rjm);
  color: var(--blanco);
  border: none;
  border-radius: 0.4rem;
  padding: 0.75rem 1.6rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.service-toggle:hover,
.service-toggle:focus-visible {
  background: #b51f17;
  transform: translateY(-1px);
}

.service-panel {
  padding: 0 2.5rem 2.5rem;
}

.service-panel[hidden] {
  display: none !important;
}

.service-gallery {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.service-gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0.5rem;
}

@media (max-width: 1024px) {
  .service-summary {
    padding: 2rem;
  }
}

@media (max-width: 900px) {
  .service-header {
    flex-direction: column;
  }
  .service-cover {
    width: 100%;
    min-width: 100%;
    max-height: none;
  }
  .service-summary {
    padding: 1.75rem;
  }
}

@media (max-width: 600px) {
  .services {
    padding: 4rem 0;
  }
  .service-summary {
    padding: 1.5rem;
  }
  .service-toggle {
    width: 100%;
    text-align: center;
  }
}
/* 8 bis. Slider con imágenes centradas y recortadas */
.projects .slider {
  position: relative;
  overflow: hidden;
}

.projects .slides {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.projects .slide {
  flex: 0 0 100%;
  display: flex;               /* convierte el slide en flex container */
  justify-content: center;     /* centra horizontal */
  align-items: center;         /* centra vertical */
  overflow: hidden;            /* recorta lo que se salga */
  height: 500px;               /* la altura que ya tenías */
}

.projects .slide img {
  /* rellena la caja del slide recortando si hace falta */
  width: 100%;
  height: 100%;
  object-fit: cover;           /* cubre caja, recortando exceso */
  object-position: center;     /* centra la imagen al recortar */
}
.projects .slider-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.45);
  color: var(--blanco);
  border: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.3s ease;
  z-index: 5;
}

.projects .slider-control:hover,
.projects .slider-control:focus-visible {
  background: rgba(0, 0, 0, 0.65);
  outline: none;
}

.projects .slider-control--prev {
  left: 1rem;
}

.projects .slider-control--next {
  right: 1rem;
}

@media (max-width: 600px) {
  .projects .slider-control {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }
}

/* 9. Llamada a la acción (CTA) */
.cta {
  text-align: center;
  padding: 3rem 0;
  background: var(--gris-claro);
}
.cta h2 {
  font-family: var(--font-title);
  margin-bottom: 1rem;
}

/* 10. Contacto */
.contact {
  padding-top: 7rem;
}

.contact h2 {
  text-align: center;
  font-family: var(--font-title);
  margin-bottom: 1.5rem;
}
.contact-form {
  display: grid;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto 3rem;
}
.contact-form input,
.contact-form textarea {
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
  font-family: var(--font-base);
}
.contact-form button {
  justify-self: start;
}

/* 11. Footer */
.site-footer {
  background: var(--negro-rjm);
  color: var(--blanco);
  padding: 2rem 0;
  text-align: center;
}
.site-footer .footer-logo {
  height: 40px;
  margin-bottom: 1rem;
}
.site-footer .footer-nav a {
  color: var(--blanco);
  text-decoration: none;
  margin: 0 0.5rem;
  font-weight: 600;
}

.footer-social {
  margin-top: 1.25rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  color: var(--blanco);
  transition: transform 0.2s ease, background 0.2s ease;
}

.footer-social a:hover,
.footer-social a:focus-visible {
  background: rgba(255,255,255,0.18);
  transform: translateY(-2px);
  outline: none;
}

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}


/* 12. Responsive básico */
/* 12 bis. Nav móvil transparente y desplegable */
@media (max-width: 768px) {
  /* 1. Mostrar siempre el botón "hamburger" */
  .nav-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--blanco);
    cursor: pointer;
    z-index: 1001; /* por encima del vídeo */
  }

  /* 2. Ocultar la lista de enlaces */
  .main-nav ul {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  /* 3. Al tener .open, mostrar menú en columna */
  .main-nav.open ul {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px;    /* justo debajo del header */
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5); /* semitransparente */
    padding: 1rem 0;
    z-index: 1000;
  }

  /* 4. Estilar cada enlace dentro del menú desplegable */
  .main-nav.open ul li {
    margin: 0.5rem 0;
    text-align: center;
  }
  .main-nav.open ul a {
    color: var(--blanco);
    font-size: 1.1rem;
    text-decoration: none;
  }
}

@media (max-width: 600px) {
  .gallery-lightbox {
    gap: 1rem;
    padding: 1.5rem 1rem;
  }
  .lightbox-frame {
    max-width: 100%;
    max-height: calc(80vh - 3rem);
  }
  .lightbox-control {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }
}




.service-card[data-service="pulmones"] .service-gallery img {
  height: auto;
  max-height: 220px;
  object-fit: contain;
  background: #f5f5f5;
}

