:root {
  --surface: #fbf8ff;
  --surface-dim: #dad9e3;
  --surface-bright: #fbf8ff;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f4f2fd;
  --surface-container: #eeedf7;
  --surface-container-high: #e8e7f1;
  --surface-container-highest: #e3e1ec;
  --on-surface: #1a1b22;
  --on-surface-variant: #5d3f3c;
  --inverse-surface: #2f3038;
  --inverse-on-surface: #f1effa;
  --outline: #926f6b;
  --outline-variant: #e7bdb8;
  --surface-tint: #c00014;
  --primary: #ba0013;
  --on-primary: #ffffff;
  --primary-container: #e31e24;
  --on-primary-container: #fffafa;
  --inverse-primary: #ffb4ab;
  --secondary: #5f5e5f;
  --on-secondary: #ffffff;
  --secondary-container: #e2dfe0;
  --on-secondary-container: #636263;
  --tertiary: #5a5c5d;
  --on-tertiary: #ffffff;
  --tertiary-container: #737475;
  --on-tertiary-container: #fbfbfc;
  --background: #fbf8ff;
  --on-background: #1a1b22;
  --surface-variant: #e3e1ec;

  --font-display: 'Hanken Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-label: 'Geist', monospace;
}
html {
  scroll-padding-top: 100px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--on-background);
  /* overflow: hidden; managed by JS now */
}

/* Watermark Background */
body::after {
  content: "";
  background-image: url('../images/logo_watermark.png');
  background-size: 50%;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  opacity: 0.09;
  pointer-events: none;
}

/* --- Loader Screen --- */
#loader-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--surface-container-lowest);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

.svg-wrapper {
  width: 600px;
  height: 200px;
  position: relative;
}

.animated-letter {
  opacity: 0;
  animation: letterRevealOnce 0.35s forwards;
  animation-delay: var(--delay);
  will-change: opacity, transform, filter;
}

@keyframes letterRevealOnce {
  0% { opacity: 0; transform: scale(0.85) translateY(10px); filter: blur(5px); }
  40% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0px); }
  100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0px); }
}

.animated-text-inf {
  opacity: 0;
  animation: textReveal 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: var(--delay);
  will-change: opacity, transform, filter;
}

@keyframes textReveal {
  0% { opacity: 0; transform: translateY(10px) scale(0.95); filter: blur(3px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0px); }
}

body.loading {
  overflow: hidden;
}
body.loaded {
  overflow: auto;
}

body.loaded #loader-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* --- Main Content (Industrial Precision) --- */
#main-content {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease-in-out;
}
body.loaded #main-content {
  opacity: 1;
  visibility: visible;
}

/* Utilities */
.sharp {
  border-radius: 0 !important;
}

/* Top Bar */
.top-bar {
  background-color: var(--on-surface);
  color: var(--surface-container-lowest);
  border-bottom: 1px solid var(--inverse-surface);
  padding: 8px 0;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.top-bar a {
  color: var(--surface-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.top-bar a:hover {
  color: var(--primary-container);
}
.top-bar-social a {
  margin-left: 16px;
  font-size: 14px;
}

/* Navbar */
.navbar-brand img {
  height: 80px;
}
.navbar {
  background-color: var(--surface-container-lowest);
  border-bottom: 1px solid var(--surface-container-highest);
  min-height: 100px;
  padding: 0;
  display: flex;
  align-items: center;
}
.nav-link {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface) !important;
  margin: 0 16px;
  transition: color 0.2s;
}
.nav-link:hover {
  color: var(--primary-container) !important;
}
.dropdown-menu {
  border-radius: 0; /* Industrial sharp theme */
  border: 1px solid var(--surface-container-highest);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  background-color: var(--surface-container-low); /* Different color than navbar */
}
.navbar .dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.15em;
  content: "";
  border-top: 0.3em solid transparent;
  border-bottom: 0.3em solid transparent;
  border-left: 0.3em solid;
  border-right: 0;
  transition: transform 0.25s ease;
}
.navbar .nav-item.dropdown:hover .dropdown-toggle::after,
.navbar .dropdown-toggle[aria-expanded="true"]::after {
  transform: rotate(90deg); /* Points down when open */
}

@media (min-width: 992px) {
  /* Hover to open dropdown on desktop */
  .navbar .nav-item.dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .navbar .dropdown-menu {
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    top: 100%;
    margin-top: 22px; /* Positioned exactly below the 100px navbar */
  }
  /* Invisible bridge to keep hover state active when moving cursor to menu */
  .navbar .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    height: 25px;
    background: transparent;
  }
}
.dropdown-item {
  font-family: var(--font-body);
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 10px 20px;
  color: var(--on-surface);
  transition: all 0.2s;
}
.dropdown-item:hover {
  background-color: var(--surface-container-low);
  color: var(--primary-container);
}
.btn-primary-industrial {
  background-color: var(--on-surface);
  color: var(--surface-container-lowest);
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 24px;
  transition: background-color 0.2s;
}
.btn-primary-industrial:hover {
  background-color: var(--primary-container);
  color: #fff;
}

@media (max-width: 991px) {
  .navbar-collapse.show {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 15px;
  }
  .navbar-nav {
    align-items: center;
    margin-bottom: 15px;
    width: 100%;
  }
  .dropdown-menu {
    text-align: center;
    background-color: var(--surface-container-low);
    border: none;
  }
  .dropdown-item {
    font-family: var(--font-body);
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--on-surface) !important;
    padding: 8px 0;
  }
  .dropdown-item:hover {
    background-color: var(--surface-container-high);
    color: var(--primary-container) !important;
  }
  .navbar-collapse.show .btn-primary-industrial {
    align-self: center;
    width: fit-content;
  }
}

/* Hero Carousel */
.hero-carousel {
  position: relative;
}
.hero-carousel .carousel-item {
  height: 600px;
  background-color: var(--inverse-surface);
}
.hero-carousel .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  opacity: 0.8; /* Subtle dark overlay to ensure text legibility */
}
.carousel-caption {
  bottom: 50%;
  transform: translateY(50%);
  text-align: left;
  left: 10%;
  right: 10%;
}
.carousel-caption h1 {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 800;
  line-height: 72px;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
@media (max-width: 768px) {
  .hero-carousel .carousel-item {
    height: 350px;
  }
  .hero-carousel .carousel-item img {
    object-fit: cover;
    object-position: left center;
  }
  .carousel-caption h1 {
    font-size: 32px;
    line-height: 40px;
  }
}

/* Brands Section */
.brands-section {
  padding: 64px 0;
  background-color: var(--surface-container-low);
  border-bottom: 1px solid var(--surface-container-highest);
}
.brands-title {
  font-family: var(--font-label);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-variant);
  margin-bottom: 32px;
  text-align: center;
}

/* Desktop layout */
.brands-desktop .brand-item {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

/* Mobile layout (slider) */
.brand-slider {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.brand-slide-track {
  display: flex;
  width: 450%; /* 6 items total, showing ~1.3 at a time (6/1.33 = 4.5 or 450%) */
  animation: scrollMarquee 15s linear infinite;
}

.brand-slide-track:hover {
  animation-play-state: paused;
}

.brand-slide {
  width: 16.666%; /* 100% / 6 items */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
}

@keyframes scrollMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); } /* Scrolls exactly the width of the 3 original items (50% of 300% width) */
}

.brand-slide-track-2 {
  display: flex;
  width: 300%; /* 4 items total, showing ~1.3 at a time (4/1.33 = 3.0 or 300%) */
  animation: scrollMarquee2 10s linear infinite;
}

.brand-slide-track-2:hover {
  animation-play-state: paused;
}

.brand-slide-track-2 .brand-slide {
  width: 25%; /* 100% / 4 items */
}

@keyframes scrollMarquee2 {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); } /* Scrolls exactly 2 items */
}

.brand-logo {
  height: 100px;
  width: 200px;
  max-width: 100%; /* Ensure images shrink to fit their container on small screens */
  object-fit: contain;
  transition: all 0.3s ease;
  cursor: pointer;
}

.logo-scale-pf {
  transform: scale(1.4);
}

.logo-scale-hayward {
  transform: scale(1.3);
}

@media (max-width: 767px) {
  .logo-scale-pf {
    transform: scale(1.2);
  }
  .logo-scale-hayward {
    transform: scale(1.1);
  }
}

/* Footer */
.footer {
  background-color: var(--on-surface);
  color: var(--surface-container-lowest);
  padding: 64px 0 32px;
  font-family: var(--font-body);
}
.footer h5 {
  font-family: var(--font-display);
  font-size: 24px;
  margin-bottom: 24px;
  color: var(--surface-container-lowest);
}
.footer ul {
  list-style: none;
  padding: 0;
}
.footer li {
  margin-bottom: 12px;
}
.footer a {
  color: var(--surface-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.footer a:hover {
  color: var(--primary-container);
}
.map-container {
  border: 1px solid var(--surface-dim);
  height: 200px;
  width: 100%;
  background-color: var(--inverse-surface);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--surface-dim);
  font-family: var(--font-label);
}
.footer-bottom {
  border-top: 1px solid var(--inverse-surface);
  margin-top: 48px;
  padding-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--surface-dim);
}

/* Products Section */
.products-section {
  background-color: transparent;
}
.product-item {
  background-color: var(--surface-container-lowest);
  border: 1px solid var(--surface-container-highest);
  padding: 30px 20px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-top: 4px solid var(--on-surface);
}
.product-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
  border-top-color: var(--primary-container);
  background-color: var(--surface-container-low);
}
.product-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--on-surface);
  margin: 0;
}
.product-img {
  object-fit: contain;
  width: 100%;
  height: 250px;
}

.btn-product-special {
  background-color: #000000;
  color: #ffffff;
  border: 2px solid #000000;
  border-radius: 50px !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.btn-product-special:hover {
  background-color: var(--primary-color, #e60000);
  border-color: var(--primary-color, #e60000);
  color: #ffffff;
  box-shadow: 0 5px 15px rgba(230, 0, 0, 0.3);
}

/* Soluciones Desarrolladas Section */
.solution-card {
  display: block;
  text-decoration: none !important;
  background-color: var(--secondary);
  border: 1px solid var(--secondary);
  border-top: 4px solid var(--on-secondary);
  padding: 0;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.solution-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  border-top-color: var(--primary);
  background-color: var(--inverse-surface);
}
.solution-card-img {
  width: 100%;
  height: 200px;
  background-color: var(--tertiary);
  object-fit: cover;
}
.solution-card-body {
  padding: 24px 20px;
}
.solution-card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--on-secondary);
  margin: 0;
}
.solution-content {
  border-left: 4px solid var(--secondary);
  transition: border-color 0.3s ease;
}
.solution-card:hover .solution-content {
  border-left-color: var(--primary);
}
.solution-card-desc {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

/* --- Solutions Detail Page --- */
.solution-banner {
  position: relative;
  height: 400px;
  overflow: hidden;
  background-color: #000000; /* Fondo negro para oscurecer la imagen */
}
.solution-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2; /* Máscara oscura: 50% de opacidad sobre fondo negro */
}
.solution-banner .banner-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 40px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}
.solution-banner h1 {
  color: #fff;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  margin: 0;
}

.solution-description {
  background-color: var(--surface-container-lowest);
  border: 1px solid var(--surface-container-highest);
  border-top: 4px solid var(--primary-container);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  font-size: 16px;
  line-height: 1.8;
  color: var(--on-surface-variant);
}

.solution-description p {
  margin-bottom: 20px;
}
.solution-description p:last-child {
  margin-bottom: 0;
}

.other-solutions-sidebar {
  background-color: var(--surface-container-low);
  border-radius: 8px;
  border-left: 4px solid var(--on-surface);
}

.other-solutions-sidebar h4 {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--on-surface);
  text-transform: uppercase;
}

.other-solutions-list li {
  margin-bottom: 15px;
  border-bottom: 1px solid var(--surface-container-highest);
  padding-bottom: 15px;
}

.other-solutions-list li:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.other-solutions-list a {
  text-decoration: none;
  color: var(--on-surface-variant);
  font-weight: 600;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.other-solutions-list a i {
  color: var(--primary-container);
  margin-right: 10px;
  font-size: 12px;
  transition: transform 0.3s ease;
}

.other-solutions-list a:hover {
  color: var(--primary-container);
  transform: translateX(5px);
}

/* Floating WhatsApp Button */
.floating-whatsapp {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 40px;
  right: 40px;
  background-color: #25d366;
  color: #FFF;
  border-radius: 50px;
  text-align: center;
  font-size: 30px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-whatsapp:hover {
  background-color: #128C7E;
  color: #FFF;
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.4);
}

@media (max-width: 767px) {
  .floating-whatsapp {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
    font-size: 26px;
  }
}
