:root {
  /* Colors - Industrial Stewardship */
  --surface: #001717;
  --surface-container-low: #002020;
  --surface-container-highest: #1c3939;
  --surface-bright: rgba(32, 62, 62, 0.6);
  --primary: #99cf8d;
  --on-primary: #432c00;
  --accent-yellow: #f9bc50;
  --secondary: #c2c9b4;
  --outline-variant: rgba(65, 72, 72, 0.15);
  --on-surface: #c9e9e8;
  --on-surface-variant: #c1c8c7;
  --error: #ffb4ab;
  --surface-container: #042424;

  /* Bootstrap Overrides */
  --bs-primary: #99cf8d;
  --bs-primary-rgb: 153, 207, 141;

  /* Typography */
  --font-display: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', sans-serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  background-color: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-display {
  font-family: var(--font-display);
}

/* Typography Scale */
.display-lg {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.headline-lg {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.body-lg {
  font-size: 1rem;
  font-weight: 400;
}

.label-md {
  font-family: var(--font-body);
  color: var(--secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Utilities */
.bg-surface {
  background-color: var(--surface);
}

.bg-surface-low {
  background-color: var(--surface-container-low);
}

.bg-surface-highest {
  background-color: var(--surface-container-highest);
}

.text-primary {
  color: var(--primary) !important;
}

.text-secondary {
  color: var(--secondary) !important;
}

.text-on-surface {
  color: var(--on-surface) !important;
}

.text-on-surface-variant {
  color: var(--on-surface-variant) !important;
}

/* The "No-Line" Rule - Tonal Layering */
.tonal-card {
  background-color: var(--surface-container-low);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--outline-variant);
}

.tonal-card:hover {
  background-color: var(--surface-container-highest);
  box-shadow: 0 0 24px rgba(201, 233, 232, 0.8);
  /* Ambient glow */
}

/* The "Glass & Gradient" Rule */
.navbar-glass {
  background-color: #001717 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid var(--outline-variant);
  transition: all 0.3s ease;
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

/* Yellow Hamburger Toggler */
.navbar-toggler {
  color: var(--accent-yellow) !important;
  padding: 0.35rem 0.65rem;
}

.navbar-toggler .material-symbols-outlined {
  color: var(--accent-yellow) !important;
  font-size: 2.5rem;
}

/* Responsive Navbar Logo & Mobile Adaptation (Prominent Large Header Logo) */
.navbar-brand {
  max-width: 80%;
  display: inline-flex;
  align-items: center;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0;
  margin-bottom: 0;
}

.navbar-brand img.navbar-logo {
  max-width: 580px;
  max-height: 105px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: max-width 0.3s ease, max-height 0.3s ease;
}

@media (max-width: 991.98px) {
  html {
    scroll-padding-top: 80px;
  }
  .navbar-glass {
    background-color: #001717 !important;
    opacity: 1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }
  .navbar-brand {
    max-width: 75%;
  }
  .navbar-brand img.navbar-logo {
    max-width: 400px;
    max-height: 82px;
  }
  .navbar-collapse {
    width: calc(100% + 2rem);
    margin-left: -1rem;
    margin-right: -1rem;
    background: #001717 !important;
    padding: 1.5rem 2rem;
    border-radius: 0;
    margin-top: 0.75rem;
    border-top: 1px solid var(--outline-variant);
    border-bottom: 1px solid var(--outline-variant);
    border-left: none;
    border-right: none;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6);
  }
}

@media (max-width: 575.98px) {
  .navbar-brand {
    max-width: 75%;
  }
  .navbar-brand img.navbar-logo {
    max-width: 310px;
    max-height: 68px;
  }
  .navbar-collapse {
    width: calc(100% + 1.5rem);
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    padding: 1.25rem 1.5rem;
  }
  .display-lg {
    font-size: 2.25rem;
  }
  .headline-lg {
    font-size: 1.5rem;
  }
  .section-padding {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

.hero-gradient {
  background: radial-gradient(circle at top right, #291a00 0%, var(--surface) 60%);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(0, 23, 23, 0.85) 30%, rgba(0, 23, 23, 0.15) 100%);
}

/* Buttons (The "Actuators") */
.btn-primary-industrial {
  background-color: var(--accent-yellow);
  color: var(--on-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 0.375rem;
  padding: 1rem 2rem;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 0 0 rgba(255, 255, 255, 0);
}

.btn-primary-industrial:hover {
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  color: var(--on-primary);
}

.btn-secondary-industrial {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid rgba(139, 146, 145, 0.2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 0.375rem;
  padding: 1rem 2rem;
  transition: all 0.3s ease;
}

.btn-secondary-industrial:hover {
  background-color: rgba(153, 207, 141, 0.1);
  color: var(--primary);
}

.btn-tertiary {
  color: var(--secondary);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: all 0.3s ease;
}

.btn-tertiary:hover {
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
}

/* Input Fields */
.industrial-input {
  background-color: var(--surface-container-highest);
  border: none;
  border-bottom: 2px solid var(--secondary);
  color: var(--on-surface);
  padding: 1rem;
  border-radius: 4px 4px 0 0;
  transition: all 0.3s ease;
}

.industrial-input:focus {
  outline: none;
  background-color: var(--surface-container-highest);
  border-bottom-color: var(--primary);
  color: var(--on-surface);
  box-shadow: none;
}

.industrial-input::placeholder {
  color: rgba(193, 200, 199, 0.5);
}

/* Spacing and Utilities */
.section-padding {
  padding-top: 4rem;
  padding-bottom: 5rem;
}

#about,
#equipos {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

/* Padding amplio para escritorio en Quiénes Somos y Servicios */
@media (min-width: 992px) {
  #about {
    padding-top: 7rem !important;
    padding-bottom: 7.5rem !important;
  }

  .services-parallax {
    padding-top: 7.5rem !important;
    padding-bottom: 8rem !important;
  }
}

/* Hero Carousel & Screen Adaptive Engine */
.hero-carousel {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background-color: var(--surface);
}

.hero-slide {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 1.2s ease-in-out;
  z-index: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.hero-content-wrapper {
  padding-top: 5rem;
  padding-bottom: 2.5rem;
  margin-top: 2rem;
}

.hero-img-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.hero-img-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center; /* Por defecto muestra el centro */
  z-index: 1;
  opacity: 1;
  transform: scale(1);
  transition: transform 8s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

/* Clases utilitarias de encuadre para imágenes */
.focus-right,
.hero-focus-right,
.hero-img-container img.focus-right {
  object-position: right center !important;
}

.focus-center,
.hero-focus-center,
.hero-img-container img.focus-center {
  object-position: center center !important;
}

.focus-left,
.hero-focus-left,
.hero-img-container img.focus-left {
  object-position: left center !important;
}

.hero-slide.active .hero-img-container img {
  transform: scale(1.05);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(0, 23, 23, 0.92) 0%,
    rgba(0, 23, 23, 0.82) 42%,
    rgba(0, 23, 23, 0.45) 75%,
    rgba(0, 23, 23, 0.20) 100%
  );
}

@media (max-width: 991.98px) {
  .hero-carousel,
  .hero-slide {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .hero-content-wrapper {
    padding-top: 6rem;
    padding-bottom: 3rem;
    margin-top: 1rem;
  }

  .hero-overlay {
    background: linear-gradient(
      180deg,
      rgba(0, 23, 23, 0.88) 0%,
      rgba(0, 23, 23, 0.78) 55%,
      rgba(0, 23, 23, 0.45) 100%
    ) !important;
  }

  .hero-img-container img {
    object-position: center center;
    filter: brightness(0.92);
  }

  .hero-img-container img.focus-right,
  .focus-right {
    object-position: right center !important;
  }
}

@media (max-width: 575.98px) {
  .hero-content-wrapper {
    padding-top: 5rem;
    padding-bottom: 2rem;
    margin-top: 0.5rem;
  }

  .hero-img-container img {
    object-position: center center;
  }

  .hero-img-container img.focus-right,
  .focus-right {
    object-position: right center !important;
  }
}

/* Service Cards and Equipos Custom Grid */
.grid-carousel-wrapper {
  position: relative;
}

/* Services Parallax Section */
.services-parallax {
  position: relative;
  min-height: 450px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 5rem;
  padding-bottom: 5rem;
  background-image: linear-gradient(
      rgba(0, 23, 23, 0.75),
      rgba(0, 23, 23, 0.74)
    ),
    url('../images/maquinaria00.jpg');
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  overflow: hidden;
}

.services-parallax > .container-fluid {
  width: 100%;
}

.services-parallax .service-card {
  min-height: 450px;
  background-color: rgba(0, 32, 32, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(153, 207, 141, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.services-parallax .service-card:hover {
  background-color: rgba(28, 57, 57, 0.85);
  border-color: var(--primary) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(153, 207, 141, 0.2);
  transform: translateY(-4px);
  position: relative;
  z-index: 2;
}

@media (max-width: 991.98px) {
  .services-parallax {
    background-attachment: scroll;
  }
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 25;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: opacity 0.3s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-arrow svg {
  width: 57px;
  height: 57px;
  pointer-events: none;
  display: block;
}

.nav-arrow:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.06);
}

.nav-arrow:active {
  transform: translateY(-50%) scale(0.94);
}

.arrow-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden;
}

.prev-arrow {
  left: 15px;
}

.next-arrow {
  right: 15px;
}

.service-grid,
.equipos-grid {
  display: flex;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  padding-top: 10px;
  padding-bottom: 10px;
  margin-top: -10px;
  margin-bottom: -10px;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge */
  cursor: grab;
  user-select: none;
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
}

.service-grid.is-dragging,
.equipos-grid.is-dragging {
  cursor: grabbing !important;
}

.service-grid.is-scrolling *,
.equipos-grid.is-scrolling * {
  pointer-events: none !important;
}

.service-grid img,
.equipos-grid img {
  pointer-events: none;
}

.service-grid::-webkit-scrollbar,
.equipos-grid::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

/* Equipos Cards Hover Glow */
#equipos .tonal-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#equipos .tonal-card:hover {
  background-color: var(--surface-container-highest);
  border-color: var(--primary);
  box-shadow: 0 8px 30px rgba(153, 207, 141, 0.35), 0 0 15px rgba(153, 207, 141, 0.2);
  transform: translateY(-4px);
  position: relative;
  z-index: 2;
}

.service-card {
  flex: 0 0 330px;
  min-width: 300px;
  border: 1px solid var(--outline-variant);
  margin-right: -1px;
  margin-bottom: -1px;
  overflow: hidden;
}

.service-img-wrapper {
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
}

.service-card-img {
  width: 100% !important;
  max-width: 100% !important;
  height: 220px;
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
  display: block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover .service-card-img {
  transform: scale(1.04);
}

@media (max-width: 767.98px) {
  .service-card {
    flex: 0 0 285px;
    min-width: 285px;
  }

  .service-card-img {
    height: 180px;
  }
}

.icon-large {
  font-size: 3rem;
  color: var(--accent-yellow);
}

.service-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  color: rgba(139, 146, 145, 0.2);
}

.service-number.service-infinity {
  font-size: 5.8rem;
  line-height: 0.7;
  display: inline-block;
  vertical-align: top;
}

/* Animations */
.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-up.active {
  opacity: 1;
  transform: translateY(0);
}

/* Miscellaneous */
::selection {
  background-color: var(--primary);
  color: var(--on-primary);
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
  padding-left: 0;
}

.navbar-nav {
  padding: 0.5rem 1rem;

}

.nav-item {
  white-space: nowrap;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background-color: var(--accent-yellow);
  color: var(--surface-container-low);
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.back-to-top .material-symbols-outlined {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--surface-container-low);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(249, 188, 80, 0.4);
  background-color: #ffc86b;
}