#main-header {
  position: relative;
  z-index: 1000;
  overflow: hidden;
  min-height: 5rem;
  transition: min-height 0.3s ease, background-color 0.3s ease;
  transform: translateZ(0);
  backface-visibility: hidden;
  background-color: #ffffff !important;
}

.dark #main-header {
  background-color: #000000 !important;
}

#main-header.header-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  background-color: #ffffff !important;
}

.dark #main-header.header-sticky {
  background-color: #000000 !important;
}

.dark a.text-blue-600 {
  color: #3b82f6 !important;
}

#logo-container {
  transition: transform 0.3s ease;
  transform-origin: left center;
}

#certificate-container,
#header-divider {
  transition: opacity 0.3s ease;
}

#main-header.header-compact {
  min-height: 3.5rem;
}

#main-header.header-compact #logo-container {
  transform: scale(0.8);
}

#main-header.header-compact #certificate-container,
#main-header.header-compact #header-divider {
  opacity: 0;
  pointer-events: none;
}

#top-right-buttons-container {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

@media (max-width: 1100px) {
  #top-right-buttons-container {
    display: none !important;
  }
}

#main-nav {
  position: absolute;
  right: 9rem;
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#main-header.header-compact #main-nav {
  transform: translateX(calc(-50vw + 10.5rem + 50%));
}

#main-nav > div {
  display: flex;
  gap: 0.2rem;
  padding: 0 0.5rem;
}

#main-nav a {
  padding: 0 0.5rem;
}

@media (min-width: 1920px) {
  #main-header {
    min-height: clamp(5rem, 5rem + (100vw - 1920px) * 0.05, 10rem) !important;
  }

  #logo-link {
    height: clamp(3.5rem, 3.5rem + (100vw - 1920px) * 0.035, 7rem) !important;
  }

  #header-divider {
    height: clamp(3rem, 3rem + (100vw - 1920px) * 0.03, 6rem) !important;
    margin-left: clamp(0.5rem, 0.5rem + (100vw - 1920px) * 0.005, 1rem) !important;
    margin-right: clamp(0.5rem, 0.5rem + (100vw - 1920px) * 0.005, 1rem) !important;
  }

  #certificate-container {
    height: clamp(4rem, 4rem + (100vw - 1920px) * 0.04, 8rem) !important;
    width: clamp(10rem, 10rem + (100vw - 1920px) * 0.1, 20rem) !important;
  }

  #main-nav a {
    font-size: clamp(1rem, 1rem + (100vw - 1920px) * 0.008, 1.5rem) !important;
    padding: 0 clamp(0.5rem, 0.5rem + (100vw - 1920px) * 0.005, 1rem) !important;
  }

  #main-nav > div {
    gap: clamp(0.2rem, 0.2rem + (100vw - 1920px) * 0.002, 0.5rem) !important;
  }

  #dark-mode-btn,
  #language-dropdown-btn {
    width: clamp(2.5rem, 2.5rem + (100vw - 1920px) * 0.025, 5rem) !important;
    height: clamp(2.5rem, 2.5rem + (100vw - 1920px) * 0.025, 5rem) !important;
  }

  #language-dropdown-btn {
    min-width: clamp(5.25rem, 5.25rem + (100vw - 1920px) * 0.05, 10rem) !important;
  }

  #dark-mode-btn svg,
  #language-dropdown-btn svg {
    width: clamp(1.25rem, 1.25rem + (100vw - 1920px) * 0.0125, 2.5rem) !important;
    height: clamp(1.25rem, 1.25rem + (100vw - 1920px) * 0.0125, 2.5rem) !important;
  }

  #main-header {
    padding-left: clamp(1rem, 1rem + (100vw - 1920px) * 0.01, 2rem) !important;
    padding-right: clamp(2rem, 2rem + (100vw - 1920px) * 0.02, 4rem) !important;
  }

  #main-nav {
    right: clamp(9.5rem, 9.5rem + (100vw - 1920px) * 0.095, 19rem) !important;
  }

  #main-header.header-compact #main-nav {
    transform: translateX(calc(-50vw + clamp(10.5rem, 10.5rem + (100vw - 1920px) * 0.105, 21rem) + 50%)) !important;
  }
}

@media (max-width: 1100px) {
  #main-header {
    display: none !important;
  }

  #mobile-header-custom {
    display: block !important;
  }

  .dark #mobile-header-custom,
  .dark #mobile-second-floor {
    background-color: #000000;
    border-color: #1a1a1a;
  }

  #mobile-header-custom.compact #iso-cert-mobile {
    display: none;
  }

  #mobile-controls-compact {
    display: none !important;
  }

  #mobile-menu-custom {
    transition: all 0.3s ease;
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  #mobile-menu-custom.hidden {
    opacity: 0;
    transform: translateY(-10px) translateZ(0);
    pointer-events: none;
  }

  #mobile-menu-custom:not(.hidden) {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }

  #mobile-menu-custom a {
    transition: all 0.2s ease;
    transform: translateZ(0);
  }

  #mobile-menu-custom a:hover {
    transform: translateX(4px) translateZ(0);
  }

  @media (max-width: 1100px) {
    #mobile-header-custom {
      position: sticky !important;
      width: 100%;
      top: 0;
      transform: translateZ(0);
      backface-visibility: hidden;
      will-change: height;
      z-index: 50;
    }

    #mobile-header-custom.compact #iso-cert-mobile {
      opacity: 0;
      transform: scale(0.8) translateZ(0);
      transition: opacity 0.3s ease, transform 0.3s ease;
      pointer-events: none;
      will-change: opacity, transform;
    }

    #mobile-header-custom.compact #logo-mobile {
      height: 2.5rem;
      transition: height 0.3s ease;
      will-change: height;
    }

    #mobile-header-custom.compact #mobile-second-floor {
      border-top: none;
      transition: border-top 0.3s ease;
    }

    #mobile-first-floor {
      max-height: 64px;
      overflow: hidden;
      transition: max-height 0.35s ease, opacity 0.35s ease, padding 0.35s ease;
      transform: translateZ(0);
      will-change: max-height, opacity, padding;
    }

    #mobile-header-custom.compact #mobile-first-floor {
      max-height: 0;
      opacity: 0;
      padding-top: 0.25rem;
      padding-bottom: 0.25rem;
    }

    #iso-cert-mobile {
      transition: opacity 0.3s ease, transform 0.3s ease;
      transform: translateZ(0);
      will-change: opacity, transform;
    }

    #logo-mobile {
      transition: height 0.3s ease;
      will-change: height;
    }

    #mobile-header-custom.compact {
      padding-top: 0 !important;
    }

    #mobile-header-spacer {
      height: 0;
      transition: height 0.35s ease;
      will-change: height;
    }

    #mobile-header-custom {
      box-shadow: none !important;
    }

    #mobile-second-floor {
      border-top-color: transparent !important;
    }
  }

  #mobile-header-custom.compact #mobile-first-floor {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #mobile-header-custom.compact #logo-mobile {
    height: 2.5rem;
  }
}

@media (min-width: 1100px) {
  #mobile-header-custom {
    display: none !important;
  }

  #mobile-header-spacer {
    height: 0 !important;
  }
}

#hero-container {
  position: relative;
  margin-top: -1px;
}

@media (min-width: 1100px) {
  #hero-container {
    margin-top: -1px;
  }
}

.swiper-container {
  width: 100%;
  height: 100%;
  opacity: 0;
  background-color: #000;
  transition: opacity 0.9s ease, background-color 0.3s ease;
  will-change: opacity;
}

.swiper-container.is-ready {
  opacity: 1;
}

.swiper-slide {
  position: relative;
  transition: background-color 0.3s ease;
  background-color: #000;
}

.swiper-slide picture {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.swiper-slide::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.6));
  z-index: 1;
  pointer-events: none;
}

.swiper-slide > div {
  position: relative;
  z-index: 2;
}

@media (max-width: 768px) {
  .swiper-slide img {
    object-position: top center !important;
  }

  .swiper-button-next,
  .swiper-button-prev {
    display: none !important;
  }
}

.carousel-button:empty {
  display: none;
}

.servicio-card {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.servicio-image {
  position: relative;
  transition: all 0.3s ease;
}

.servicio-card:hover .servicio-image {
  transform: scale(1.03);
}

.ver-mas-btn {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.servicio-card:hover .ver-mas-btn {
  bottom: 15px;
  opacity: 1;
}

.servicio-card:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.servicio-image.portrait {
  position: relative;
  width: 100%;
}

.servicio-image.portrait::before {
  content: "";
  display: block;
  padding-top: 100%;
}

.servicio-image.portrait > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.servicio-card .servicio-image:not(.portrait) {
  height: 12rem;
}

@media (min-width: 640px) {
  .servicio-card .servicio-image:not(.portrait) {
    height: 16rem;
  }
}

.servicio-image img.object-left-slight {
  object-position: 37% center;
}

@media (max-width: 639px) {
  .servicio-card {
    display: none;
  }

  .servicio-card:nth-child(1),
  .servicio-card:nth-child(2),
  .servicio-card:nth-child(3) {
    display: flex;
  }

  .servicios-expanded .servicio-card {
    display: flex;
  }
}

#toggle-servicios-btn {
  transition: all 0.3s ease;
}

#toggle-servicios-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 75, 140, 0.3);
}

@keyframes gt-reveal {
  from { opacity: 0; transform: translate(var(--tx, 0px), var(--ty, 22px)); }
  to { opacity: 1; transform: translate(0, 0); }
}

.reveal {
  opacity: 0;
}

.reveal.visible {
  animation: gt-reveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--d, 0s);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
  }

  .reveal.visible {
    animation: none !important;
  }
}