/* =========================================================
   ÍNDICE · ESTILOS GENERALES
   =========================================================

   01. Base · Hero principal
   02. Navbar · Estados activos
   03. Preloader
   04. Header · Logo
   05. Hero Slider
   06. Hero · Responsive
   07. Servicios · Index
   08. Servicio · Contenido
   09. Servicios · Cards
   10. Proyectos
   11. Equipo
   12. Language Switcher
   13. CV · Hero
   14. CV · Contenido
   15. Formularios
   16. CV · Responsive
   17. Servicio · Hero (Título)

   ========================================================= */



/* =========================================================
   BASE · HERO PRINCIPAL
========================================================= */

.hero {
  min-height: 60vh;
  max-height: 650px;
  background:
    linear-gradient(
      rgba(0,0,0,0.55),
      rgba(0,0,0,0.55)
    ),
    url("../img/hero.jpg") center/cover no-repeat;
}


/* =========================================================
   NAVBAR · ESTADOS ACTIVOS
========================================================= */

.navbar-dark .navbar-nav .nav-link.active {
  color: #0d6efd;
  font-weight: 600;
}

.navbar-dark .navbar-nav .nav-link.active::after {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  background-color: #0d6efd;
  margin-top: 4px;
}


/* =========================================================
   PRELOADER
========================================================= */

#preloader {
  position: fixed;
  inset: 0;
  background: #0b0f19;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

body:not(.loaded) {
  overflow: hidden;
}

.preloader-inner {
  text-align: center;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top: 4px solid #0d6efd;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

.preloader-text {
  color: #fff;
  font-weight: 600;
  letter-spacing: 2px;
  font-size: 14px;
  animation: fadeText 1.5s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeText {
  0%,100% { opacity: .3; }
  50% { opacity: 1; }
}

/* Ocultar preloader */
body.loaded #preloader {
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}


/* =========================================================
   HEADER · LOGO
========================================================= */

.logo-header {
  max-height: 42px;
  width: auto;
  display: block;
}


/* =========================================================
   HERO SLIDER
========================================================= */

.hero-slider,
.hero-slider .carousel,
.hero-slider .carousel-inner,
.hero-slider .carousel-item {
  height: 60vh;
  min-height: 420px;
  max-height: 650px;
}

.hero-slider .carousel-item {
  background-size: cover;
  background-position: center;
}

/* Overlay oscuro */
.hero-slider .carousel-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
}

.hero-slider .carousel-caption {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  text-align: left;
  color: #fff;
  max-width: 600px;
  z-index: 2;
}

.hero-slider h1 {
  font-size: 3rem;
  font-weight: 700;
}

.hero-slider p {
  font-size: 1.25rem;
}


/* =========================================================
   HERO · RESPONSIVE DEFINITIVO
========================================================= */

@media (max-width: 768px) {

  /* Altura flexible */
  .hero,
  .hero-slider,
  .hero-slider .carousel,
  .hero-slider .carousel-inner,
  .hero-slider .carousel-item {
    height: 75vh;
    min-height: 520px;
    max-height: none;
  }

  /* Centrado real */
  .hero-slider .carousel-caption {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    max-width: 92%;
    padding: 0 1rem;
  }

  /* Título */
  .hero-slider h1 {
    font-size: clamp(1.8rem, 6vw, 2.4rem);
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  /* Texto */
  .hero-slider p {
    font-size: clamp(0.95rem, 3.8vw, 1.1rem);
    line-height: 1.6;
  }

}



/* =========================================================
   SERVICIOS · INDEX
========================================================= */

.service-img {
  height: 220px;
  object-fit: cover;
  width: 100%;
}


/* =========================================================
   SERVICIO · CONTENIDO
========================================================= */

.service-content img {
  max-width: 100%;
  height: auto;
  display: block;
}


/* =========================================================
   SERVICIOS · CARDS
========================================================= */

.service-card {
  position: relative;
  height: 100%;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.service-link {
  position: absolute;
  inset: 0;
  z-index: 5;
  text-indent: -9999px;
}

.service-card img,
.service-card .card-body {
  position: relative;
  z-index: 1;
}

.service-text {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Fix móvil */
.service-card *:not(.service-link) {
  pointer-events: none;
}

.service-link {
  pointer-events: auto;
}


/* =========================================================
   PROYECTOS
========================================================= */

.project-card {
  position: relative;
  height: 100%;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.project-img {
  height: 220px;
  width: 100%;
  object-fit: cover;
}

.project-link {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.project-card img,
.project-card .card-body {
  position: relative;
  z-index: 1;
}

.project-text {
  font-size: 0.95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* =========================================================
   EQUIPO
========================================================= */

.team-card {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  background: #f4f6f9;
}

.team-card img.main,
.team-card img.hover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: opacity 0.4s ease;
  border-radius: 12px;
}

.team-card img.main {
  z-index: 1;
  opacity: 1;
}

.team-card img.hover {
  z-index: 2;
  opacity: 0;
}

.team-card:hover img.hover {
  opacity: 1;
}

.team-card:hover img.main {
  opacity: 0;
}

.team-link {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.team-card *:not(.team-link) {
  pointer-events: none;
}

.team-link {
  pointer-events: auto;
}

/* Responsive equipo */
@media (max-width: 768px) {
  .team-card {
    aspect-ratio: 4 / 5;
  }
}

@media (max-width: 576px) {
  .team-card {
    aspect-ratio: 4 / 5;
  }
}


/* =========================================================
   LANGUAGE SWITCHER
========================================================= */

.lang-switcher {
  display: flex;
  gap: 6px;
  margin-left: 20px;
}

.lang-btn {
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.lang-btn:hover {
  border-color: #0d6efd;
  color: #0d6efd;
}

.lang-btn.active {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}


/* =========================================================
   CV · HERO
========================================================= */

.hero-cv {
  min-height: 40vh;
  display: flex;
  align-items: center;
  background:
    linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.55)),
    url("../img/hero-cv.jpg") center/cover no-repeat;
}

.hero-cv .hero-title {
  font-size: 2.6rem;
  font-weight: 600;
}


/* =========================================================
   CV · CONTENIDO
========================================================= */

.cv-section {
  padding: 5rem 0;
}

.cv-intro {
  max-width: 820px;
  margin-bottom: 3rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #334155;
}

.cv-intro p {
  margin-bottom: 1.25rem;
}

.cv-sign {
  margin-top: 2rem;
}


/* =========================================================
   FORMULARIOS
========================================================= */

.cv-form {
  max-width: 620px;
}

.cv-form .form-control,
.cv-form .form-select {
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
}

.cv-form .btn {
  padding: 0.6rem 2rem;
}


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

@media (max-width: 768px) {

  .hero-cv {
    min-height: 32vh;
  }

  .hero-cv .hero-title {
    font-size: 2.1rem;
  }

  .cv-section {
    padding: 4rem 0;
  }
}


/* =========================================================
   SERVICIO · HERO (TÍTULO)
========================================================= */

.service-title {
  margin-top: 3rem;
}

.hero-seccion .service-title {
  margin-top: 3rem;
}