/* Reset y tipografía */
*,
*::before,
*::after {
  box-sizing: border-box;
}
/* logo*/
.logo {
  height: 50px; /* ajusta según tu diseño */
  width: auto;
  margin-right: 10px;
  vertical-align: middle;
}
.navbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand-text {
  font-weight: bold;
  color: #fff; /* o el color que uses */
  margin-left: 8px;
}
.brand-tagline {
  font-size: 0.8rem;
  color: #ccc;
  margin-left: 5px;
}
/* logo*/

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', 'Montserrat', sans-serif;
  overflow-x: hidden;
  width: 100%;
}

/* Variables de colores */
:root {
  --primary-color: #1a3d5d;
  --secondary-color: #d4af37;
  --accent-color: #4a752c;
  --dark-bg: #2c2c2c;
  --light-bg: #f8f9fa;
}

/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;
  animation: preloaderAutoHide 0.01s linear 2s forwards;
}

#preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader {
  width: 150px;
  height: 150px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.loader-ring {
  width: 118px;
  height: 118px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-ring::before,
.loader-ring::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.loader-ring::before {
  inset: 0;
  border: 4px solid rgba(26, 61, 93, 0.12);
  border-top-color: var(--primary-color);
  border-right-color: var(--secondary-color);
  animation: preloaderSpin 0.9s linear infinite;
}

.loader-ring::after {
  inset: 10px;
  border: 2px solid rgba(212, 175, 55, 0.18);
  border-bottom-color: var(--secondary-color);
  animation: preloaderSpinReverse 1.15s linear infinite;
}

.preloader-logo {
  position: relative;
  z-index: 2;
  width: 72px;
  height: 72px;
  object-fit: contain;
  animation: preloaderPulse 1.2s ease-in-out infinite;
}

.preloader-text {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary-color);
  font-size: 0.9rem;
}

@keyframes preloaderSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes preloaderSpinReverse {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes preloaderPulse {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.9;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes preloaderAutoHide {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

/* Botón toggle de vistas */
.view-toggle-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1100;
}
.view-toggle-btn {
  background: var(--secondary-color);
  border: none;
  padding: 10px 15px;
  border-radius: 50px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.3s;
}
.view-toggle-btn:hover {
  background: var(--accent-color);
}

/* Navbar */
#main-navbar {
  background: var(--primary-color);
  transition: background 0.3s;
}
.navbar-brand .brand-text {
  font-weight: 600;
  font-size: 1.5rem;
}
.navbar-brand .brand-tagline {
  font-size: 0.9rem;
  color: var(--secondary-color);
}
.navbar-nav .nav-link {
  color: #fff;
  font-weight: 500;
  transition: background 0.3s;
  display: flex;
  align-items: center;
}
.navbar-nav .nav-link:hover {
  background: var(--secondary-color);
  border-radius: 5px;
}
.nav-toggle-btn {
  border-color: var(--secondary-color);
}

/* Hero Sections */
.hero-section {
  height: 100vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  position: relative;
  padding: 0 1rem;
  text-align: center;
}
.hero-content {
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
.empresa-hero {
  background:
    linear-gradient(rgba(26, 61, 93, 0.7), rgba(26, 61, 93, 0.7)),
    url('yafer-imagenes/quienes somos/LostFile_JPG_265214696\ -\ copia\ -\ copia.jpg')
      no-repeat center/cover;
}
.empleador-hero {
  /* El fondo pesado solo se aplica cuando la vista Empleador está visible. */
  background: linear-gradient(rgba(74, 117, 44, 0.7), rgba(74, 117, 44, 0.4));
}

#empleador-content:not(.d-none) .empleador-hero {
  background:
    linear-gradient(rgba(74, 117, 44, 0.7), rgba(74, 117, 44, 0.4)),
    url('yafer-imagenes/empleador/IMG_20171128_115231.jpg') no-repeat
      center/cover;
}
.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.hero-subtitle {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}
.hero-description {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}
.hero-buttons a {
  margin-right: 10px;
}
.hero-scroll-indicator {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}
.hero-scroll-indicator a {
  font-size: 2rem;
  color: #fff;
}

/* Secciones internas */
.section-header {
  margin-bottom: 2rem;
}
.section-header .section-badge {
  display: inline-block;
  background: var(--secondary-color);
  color: #fff;
  padding: 5px 10px;
  border-radius: 50px;
  font-weight: 600;
  margin-bottom: 1rem;
}
.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--dark-bg);
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--secondary-color);
}
.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: #6c757d;
}

.section-title1 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--dark-bg);
  position: relative;
}
.section-title1::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--secondary-color);
}
.section-subtitle1 {
  text-align: center;
  font-size: 1.1rem;
  color: #000000;
}

.section-title2 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--light-bg);
  position: relative;
}
.section-title2::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--secondary-color);
}
.section-subtitle2 {
  text-align: center;
  font-size: 1.1rem;
  color: #ffffff;
}

/* Tarjetas y Cards Uniformes */
.uniform-card {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.service-card i {
  display: block;
  margin: 0 auto 15px;
}
.project-card img,
.vacancy-card img {
  width: 100%;
  border-radius: 8px;
}
.vacancy-badge {
  background: var(--secondary-color);
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 10px;
}
.uniform-benefit {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.benefit-icon,
.requirement-icon {
  text-align: center;
  margin-bottom: 10px;
  font-size: 3rem;
}

/* Timeline en Postulación */
.timeline {
  border-left: 3px solid var(--secondary-color);
  padding-left: 30px;
}
.timeline-item {
  margin-bottom: 20px;
  position: relative;
}
.timeline-dot {
  position: absolute;
  left: -35px;
  top: 0;
  width: 30px;
  height: 30px;
  background: var(--secondary-color);
  border-radius: 50%;
  font-weight: 600;
  color: #fff;
  text-align: center;
  line-height: 30px;
}
.timeline-content h3 {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

/* Formularios de contacto y secciones de Contacto */
.contact-section {
  background: var(--primary-color);
  color: #fff;
  padding: 4rem 0;
}
.contact-section input,
.contact-section textarea,
.contact-section select {
  border: none;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  background: #fff;
  color: #333;
}
.contact-section input:focus,
.contact-section textarea:focus,
.contact-section select:focus {
  outline: none;
  box-shadow: 0 0 5px var(--secondary-color);
}
.contact-info-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  color: var(--primary-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.contact-info-card i {
  font-size: 1.5rem;
  margin-right: 10px;
}
.contact-form-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  color: var(--primary-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Footer */
.footer {
  background: var(--primary-color);
  color: #fff;
  padding: 1rem 0;
  text-align: center;
}
.footer-link {
  color: #fff;
  text-decoration: none;
  margin: 0 0.5rem;
  transition: color 0.3s;
}
.footer-link:hover {
  color: var(--secondary-color);
}

/* Utilidades */
.d-none {
  display: none !important;
}

/* Estilos para las nuevas secciones */
.service-category {
  margin-bottom: 3rem;
}

.service-category-title {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--secondary-color);
}

.service-description {
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.service-description ul {
  padding-left: 1.5rem;
  margin-bottom: 0;
}

.service-description li {
  margin-bottom: 0.5rem;
}

.image-carousel {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.carousel-item {
  height: 300px;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Valores */
.values-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.value-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  width: 140px;
  text-align: center;
  transition: transform 0.3s;
}

.value-item:hover {
  transform: translateY(-5px);
}

.value-item i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.value-item span {
  font-weight: 600;
}

/* Mision y Vision */
.mission-vision-card {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  height: 100%;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.mission-vision-card i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.mission-vision-card h3 {
  margin-bottom: 1rem;
}

/* Certificaciones */
.certifications {
  margin-top: 1.5rem;
}

.certifications h4 {
  margin-bottom: 1rem;
}

.certifications ul {
  padding-left: 1.5rem;
}

.certifications li {
  margin-bottom: 0.5rem;
}

/* Responsive - Solución específica para el scroll horizontal */
@media (max-width: 768px) {
  /* Prevenir desbordamiento en móviles */
  html,
  body {
    width: 100%;
    overflow-x: hidden;
    position: relative;
  }

  .container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Asegurar que las imágenes no causen overflow */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Ajustes específicos para elementos que podrían causar desbordamiento */
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.5rem;
  }

  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .hero-buttons a {
    margin-right: 0;
    width: 100%;
  }

  .values-container {
    justify-content: space-around;
  }

  .value-item {
    width: calc(50% - 0.5rem);
    margin-bottom: 1rem;
  }

  /* Asegurar que los carruseles no causen desbordamiento */
  .carousel {
    max-width: 100%;
  }

  .carousel-item {
    height: 250px;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 1.3rem;
  }

  .section-title,
  .section-title1,
  .section-title2 {
    font-size: 2rem;
  }

  .value-item {
    width: 100%;
  }

  .carousel-item {
    height: 200px;
  }
}

/* Reglas específicas para prevenir el scroll horizontal */
.row {
  margin-left: 0;
  margin-right: 0;
}

.col,
[class*='col-'] {
  padding-left: 15px;
  padding-right: 15px;
}

/* Asegurar que todos los elementos con position absolute no causen desbordamiento */
.hero-section,
.view-toggle-container {
  left: 0;
  right: 0;
}

/* Corregir posibles problemas con elementos flex */
.d-flex {
  flex-wrap: wrap;
}

/* Prevenir que los textos largos causen desbordamiento */
.text-break {
  word-break: break-word;
}

/* =========================
   Rediseño sección Servicios - Tarjetas
   ========================= */

/* Animated gradient background behind the section header */
.section-header .services-bg-anim {
  position: absolute;
  inset: -40px -10% auto -10%;
  height: 220px;
  z-index: 0;
  filter: blur(48px);
  opacity: 0.35;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(26, 61, 93, 0.8),
    rgba(212, 175, 55, 0.9),
    rgba(26, 61, 93, 0.6)
  );
  background-size: 200% 200%;
  animation: gradientShift 10s linear infinite;
  border-radius: 20px;
}

/* Gradient keyframes */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Title gradient text */
.gradient-text {
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  z-index: 1;
  position: relative;
}

/* Service cards modern - Versión Tarjetas */
.service-card-modern {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 14px;
  padding: 1.8rem 1.25rem;
  text-align: center;
  box-shadow: 0 6px 22px rgba(26, 61, 93, 0.08);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.service-card-modern::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(0, 0, 0, 0.02)
  );
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.service-card-modern:hover {
  transform: translateY(-10px);
  box-shadow: 0 18px 40px rgba(26, 61, 93, 0.14);
}
.service-card-modern:hover::after {
  opacity: 1;
}

/* Icon */
.service-icon {
  font-size: 2.6rem;
  color: var(--secondary-color);
  margin-bottom: 0.9rem;
  z-index: 2;
}

/* Headings and text */
.service-card-modern h4 {
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
  z-index: 2;
  font-size: 1.3rem;
  min-height: 3rem;
}

.service-content {
  flex: 1;
  margin-bottom: 1rem;
  z-index: 2;
  text-align: left;
}

.service-content ul {
  padding-left: 1.2rem;
  margin-bottom: 0;
}

.service-content li {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #555;
}

.service-content p {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 0;
}

/* Image carousel dentro de tarjetas */
.service-card-modern .image-carousel {
  margin-top: auto;
}

.service-card-modern .carousel {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.service-card-modern .carousel-item {
  height: 150px;
}

.service-card-modern .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-card-modern .carousel-indicators {
  margin-bottom: 5px;
}

.service-card-modern .carousel-indicators button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 3px;
}

/* Learn more link */
.btn-learn-more {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 600;
  z-index: 2;
  margin-top: 1rem;
  display: inline-block;
  transition: color 0.3s;
}
.btn-learn-more i {
  transition: transform 0.25s;
}
.btn-learn-more:hover {
  color: var(--secondary-color);
}
.btn-learn-more:hover i {
  transform: translateX(6px);
}

/* Placeholder image para consultoría */
.placeholder-image {
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
}

.placeholder-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* responsive tweaks */
@media (max-width: 768px) {
  .section-header .services-bg-anim {
    height: 160px;
    inset: -30px -8% auto -8%;
    filter: blur(36px);
  }

  .service-icon {
    font-size: 2.2rem;
  }

  .service-card-modern {
    padding: 1.2rem;
  }

  .service-card-modern h4 {
    font-size: 1.2rem;
  }

  .service-content li {
    font-size: 0.85rem;
  }
}

@media (max-width: 576px) {
  .service-card-modern .carousel-item {
    height: 120px;
  }
}

/* =========================================
   NAVBAR RESPONSIVE
   Corrección YAFER S.A.C
   ========================================= */

/* Escritorio */
.navbar-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.navbar-brand .logo {
  flex-shrink: 0;
}

.navbar-brand .brand-text {
  white-space: nowrap;
  flex-shrink: 0;
}

.navbar-brand .brand-tagline {
  white-space: nowrap;
  flex-shrink: 1;
}

/* Tablets */
@media (max-width: 991.98px) {
  .navbar-brand {
    max-width: calc(100% - 60px);
    overflow: hidden;
  }

  .navbar-brand .brand-tagline {
    font-size: 0.75rem;
    margin-left: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Móviles */
@media (max-width: 576px) {
  #main-navbar .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .navbar-brand {
    max-width: calc(100% - 55px);
    gap: 0;
  }

  .navbar-brand .logo {
    height: 38px;
    width: auto;
    margin-right: 6px;
  }

  .navbar-brand .brand-text {
    font-size: 1.05rem;
    margin-left: 0;
  }

  .navbar-brand .brand-tagline {
    font-size: 0.65rem;
    margin-left: 5px;
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Móviles pequeños */
@media (max-width: 380px) {
  .navbar-brand .logo {
    height: 34px;
  }

  .navbar-brand .brand-text {
    font-size: 0.95rem;
  }

  .navbar-brand .brand-tagline {
    font-size: 0.58rem;
    max-width: 75px;
  }
}

/* =========================================
   Optimización final + responsive estable
   ========================================= */

/* Evita que textos flexibles empujen al botón hamburguesa. */
.navbar > .container,
.navbar-brand,
.navbar-collapse {
  min-width: 0;
}

.navbar-brand {
  max-width: 100%;
}

.navbar-brand .brand-text,
.navbar-brand .brand-tagline {
  overflow: hidden;
  text-overflow: ellipsis;
}

img {
  max-width: 100%;
}

/* Cambio de vista: mostrar contenido inmediatamente mientras AOS se actualiza. */
.view-transition-instant [data-aos] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Asegura que botones largos y formularios no desborden en móviles. */
.btn,
.form-control,
.form-select {
  max-width: 100%;
}

.hero-content {
  width: 100%;
}

@media (max-width: 991.98px) {
  .hero-section {
    min-height: 100svh;
    height: auto;
    padding-top: 100px;
    padding-bottom: 80px;
  }

  .hero-title {
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .hero-subtitle,
  .hero-description {
    overflow-wrap: anywhere;
  }

  .navbar-collapse {
    max-height: calc(100vh - 76px);
    overflow-y: auto;
  }
}

@media (max-width: 576px) {
  .hero-section {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .hero-title {
    font-size: clamp(1.65rem, 8vw, 2.15rem);
  }

  .hero-subtitle {
    font-size: clamp(1.15rem, 5.5vw, 1.45rem);
  }

  .hero-description {
    font-size: 0.95rem;
  }

  .hero-buttons a {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .view-toggle-container {
    right: 12px;
    bottom: 12px;
  }

  .view-toggle-btn {
    padding: 9px 12px;
    font-size: 0.85rem;
  }

  .preloader-logo {
    width: 66px;
    height: 66px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #preloader,
  .loader-ring::before,
  .loader-ring::after,
  .preloader-logo {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
