/* ============================================
   CodecorEnergy - Solar Panel Services
   Premium Modern Stylesheet
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-light: #4ade80;
  --secondary: #0ea5e9;
  --secondary-dark: #0284c7;
  --accent: #22d3ee;
  --dark: #0f172a;
  --dark-2: #1e293b;
  --dark-3: #334155;
  --light: #f8fafc;
  --light-2: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-light: #f8fafc;
  --gradient-solar: linear-gradient(135deg, #16a34a 0%, #059669 50%, #0d9488 100%);
  --gradient-sky: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  --gradient-dark: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 30px rgba(22, 163, 74, 0.3);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---- Reset & Base ---- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;  /* prevent horizontal scroll on mobile */
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background-color: #ffffff;
  overflow-x: hidden;
  line-height: 1.6;
  /* Prevent any child from stretching beyond viewport */
  max-width: 100vw;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--dark);
}

.highlight {
  background: var(--gradient-solar);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* ---- Buttons ---- */
.btn {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 50px;
  transition: var(--transition);
  outline: none !important;
}

.btn-solar {
  background: var(--gradient-solar);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(22, 163, 74, 0.2);
}

.btn-solar:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.35);
  color: #fff;
}

.btn-outline-light-custom {
  background: transparent;
  color: #fff;
  border: 2px solid #fff;
}

.btn-outline-light-custom:hover {
  background: #fff;
  color: var(--dark);
  transform: translateY(-3px);
}

.btn-cta {
  background: var(--gradient-solar);
  color: #fff;
  border: none;
  font-size: 0.95rem;
  padding: 10px 24px;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(22, 163, 74, 0.2);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.35);
  color: #fff;
}

.btn-white {
  background: #ffffff;
  color: var(--primary-dark);
  border: none;
  box-shadow: var(--shadow-md);
}

.btn-white:hover {
  background: var(--light);
  color: var(--primary-dark);
  transform: translateY(-3px);
}

.btn-block {
  display: block;
  width: 100%;
}

/* ---- Preloader ---- */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--dark);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}

#preloader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-sun {
  width: 80px;
  height: 80px;
  position: relative;
  animation: sunSpin 8s linear infinite;
}

.loader-sun .core {
  width: 40px;
  height: 40px;
  background: var(--gradient-solar);
  border-radius: 50%;
  position: absolute;
  top: 20px;
  left: 20px;
  box-shadow: var(--shadow-glow);
}

.loader-sun .ray {
  position: absolute;
  background: var(--primary-light);
  border-radius: 4px;
  opacity: 0.8;
}

.loader-sun .ray:nth-child(1) { width: 8px; height: 16px; top: 0; left: 36px; }
.loader-sun .ray:nth-child(2) { width: 16px; height: 8px; top: 36px; right: 0; }
.loader-sun .ray:nth-child(3) { width: 8px; height: 16px; bottom: 0; left: 36px; }
.loader-sun .ray:nth-child(4) { width: 16px; height: 8px; top: 36px; left: 0; }
.loader-sun .ray:nth-child(5) { width: 12px; height: 12px; top: 12px; left: 12px; transform: rotate(45deg); }
.loader-sun .ray:nth-child(6) { width: 12px; height: 12px; top: 12px; right: 12px; transform: rotate(45deg); }
.loader-sun .ray:nth-child(7) { width: 12px; height: 12px; bottom: 12px; left: 12px; transform: rotate(45deg); }
.loader-sun .ray:nth-child(8) { width: 12px; height: 12px; bottom: 12px; right: 12px; transform: rotate(45deg); }

@keyframes sunSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---- Navbar ---- */
.navbar-custom {
  background: transparent;
  padding: 20px 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: var(--transition);
}

.navbar-custom.scrolled {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 0;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar-custom.scrolled .navbar-logo {
  height: 38px !important;
}

.navbar-custom .nav-link {
  color: rgba(255, 255, 255, 0.8) !important;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  padding: 8px 16px !important;
  transition: var(--transition);
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-item.active .nav-link {
  color: var(--primary-light) !important;
}

/* Toggler (hamburger) button */
.navbar-custom .navbar-toggler {
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  transition: var(--transition);
  outline: none !important;
  box-shadow: none !important;
}

.navbar-custom .navbar-toggler:hover {
  background: rgba(22, 163, 74, 0.15);
  border-color: rgba(22, 163, 74, 0.5);
}

.navbar-custom .navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

.navbar-toggler-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}


/* ---- Hero Section ---- */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 120px;
  overflow: hidden;
  background: var(--dark);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: 100%;
  background-image: url('../img/hero-solar.png');
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.75) 50%, rgba(15, 23, 42, 0.4) 100%);
  z-index: 2;
}

.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.hero-particles .particle {
  position: absolute;
  background: rgba(22, 163, 74, 0.3);
  border-radius: 50%;
  animation: floatUp 8s ease-in-out infinite;
}

@keyframes floatUp {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  50% { opacity: 0.8; }
  100% { transform: translateY(-10vh) scale(1.5); opacity: 0; }
}

.hero-content {
  position: relative;
  z-index: 4;
  color: #fff;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(22, 163, 74, 0.15);
  border: 1px solid rgba(22, 163, 74, 0.3);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-light);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  color:white;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

@media (max-width: 768px) {
  .hero-title { font-size: 2.5rem; }
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 35px;
  max-width: 650px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
}

.hero-stat .number {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
}

.hero-stat .label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.typed-cursor {
  opacity: 1;
  animation: blink 0.7s infinite;
  color: var(--primary-light);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---- Section Design Layouts ---- */
.section-padding {
  padding: 100px 0;
}

.bg-light {
  background-color: var(--light) !important;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 60px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(22, 163, 74, 0.08);
  color: var(--primary);
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ---- Reveal Animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* ---- Services ---- */
.service-card {
  background: #ffffff;
  padding: 40px 32px;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(22, 163, 74, 0.15);
}

.service-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(22, 163, 74, 0.08);
  color: var(--primary);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: var(--transition);
}

.service-card:hover .service-icon {
  background: var(--gradient-solar);
  color: #fff;
}

.service-card h4 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.service-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 24px;
  flex-grow: 1;
}

.service-link {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  transition: var(--transition);
}

.service-card:hover .service-link {
  color: var(--primary-dark);
}

/* ---- Video Cards ---- */
.video-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 2;
}
.video-player {
  position: absolute;
  inset: 0;
  z-index: 3;
}
.video-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  cursor: pointer;
}

/* Autoplay background video variant */
.video-card-thumb--video {
  position: relative;
  height: 260px;
  overflow: hidden;
  flex-shrink: 0;
  background: #0f172a;
}

.video-card-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  display: block;
}

.video-card-thumb--video .video-card-overlay,
.video-card-thumb--video .video-card-badge {
  position: relative;
  z-index: 1;
}


/* ---- Counter Section ---- */
.counter-section {
  background: var(--gradient-dark);
  padding: 60px 0;
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.counter-item {
  text-align: center;
}

.counter-item .count {
  font-family: 'Outfit', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary-light);
  line-height: 1;
  margin-bottom: 8px;
}

.counter-item .label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- Why Us (Dark) ---- */
.dark-section {
  background: var(--dark);
  color: #fff;
}

.dark-section .section-title {
  color: #fff;
}

.benefit-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 36px 28px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
  height: 100%;
  transition: var(--transition);
}

.benefit-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(22, 163, 74, 0.3);
  transform: translateY(-5px);
}

.benefit-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.15);
  color: var(--primary-light);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.benefit-card h4 {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.benefit-card p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ---- Infografía Interactiva (Sistemas Autónomos) ---- */
.sistema-autonomo-wrapper {
  position: relative;
  background: #ffffff;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-md);
  overflow: visible;
}

.autonomo-main-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Hotspots */
.autonomo-hotspot {
  position: absolute;
  width: 32px;
  height: 32px;
  background: var(--gradient-solar);
  border-radius: 50%;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
}

.autonomo-hotspot:hover,
.autonomo-hotspot.active {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 0 25px rgba(22, 163, 74, 0.8);
}

.hotspot-pulse {
  position: absolute;
  inset: -8px;
  border: 2px solid var(--primary-light);
  border-radius: 50%;
  opacity: 0;
  animation: hotspotPulseAnim 2s infinite;
  pointer-events: none;
}

@keyframes hotspotPulseAnim {
  0% { transform: scale(0.8); opacity: 0; }
  50% { opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Tooltips */
.autonomo-tooltip {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  color: #ffffff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 100;
}

.autonomo-tooltip.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.autonomo-tooltip .tooltip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.autonomo-tooltip .tooltip-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.autonomo-tooltip .tooltip-title {
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
}

.autonomo-tooltip .tooltip-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
  margin-bottom: 0;
}

/* ---- Products Showcase (Grid-Accordion) ---- */
.products-section {
  background: var(--light);
  position: relative;
  z-index: 1;
}

.products-section .sun-panel-animation {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 350px;
  height: 350px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}

.sun-panel-animation .sun-rays-spin {
  transform-origin: 250px 50px;
  animation: spin-rays 10s linear infinite;
}

@keyframes spin-rays {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.sun-panel-animation .sun-core {
  animation: pulse-core 3s infinite alternate;
}
.sun-panel-animation .sun-glow {
  animation: pulse-glow 3s infinite alternate;
}
.sun-panel-animation .sun-halo {
  animation: pulse-halo 4s infinite alternate;
}

@keyframes pulse-core {
  0% { r: 23px; }
  100% { r: 27px; }
}
@keyframes pulse-glow {
  0% { r: 38px; opacity: 0.3; }
  100% { r: 45px; opacity: 0.6; }
}
@keyframes pulse-halo {
  0% { r: 50px; opacity: 0.1; }
  100% { r: 60px; opacity: 0.3; }
}

.sun-panel-animation .energy-ray {
  animation: energy-flow 2s linear infinite;
}
.sun-panel-animation .ray-delay-1 {
  animation-delay: 0.6s;
}
.sun-panel-animation .ray-delay-2 {
  animation-delay: 1.2s;
}

@keyframes energy-flow {
  0% { stroke-dashoffset: 36; opacity: 0.2; }
  50% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0.2; }
}

.sun-panel-animation .panel-glow {
  animation: panel-absorb 2s linear infinite;
}

@keyframes panel-absorb {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.25; }
}

@media (max-width: 768px) {
  .products-section .sun-panel-animation {
    width: 200px;
    height: 200px;
    top: -20px;
    right: -20px;
  }
  .sun-panel-animation .energy-flow,
  .sun-panel-animation .solar-panel {
    display: none;
  }
}

/* Grid cards */
.product-grid-card {
  position: relative;
  height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.product-grid-card .product-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: var(--transition);
}

.product-grid-card:hover .product-card-bg {
  transform: scale(1.08);
}

.product-grid-card .product-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(15, 23, 42, 0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}

.product-grid-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(22, 163, 74, 0.3);
}

.product-grid-card.active {
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-glow);
}

.product-card-content {
  color: #ffffff;
}

.product-card-tag {
  display: inline-block;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  margin-bottom: 8px;
}

.product-card-title {
  color: #ffffff !important;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.product-card-action {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-light);
  display: flex;
  align-items: center;
}

/* Accordion details panels (now used inside Modals) */
.product-detail-panel {
  display: block;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-md);
  margin-bottom: 0px;
  padding: 40px;
}

.product-detail-panel.active {
  margin-bottom: 30px;
}

.detail-title {
  font-size: 2rem;
  margin-bottom: 12px;
}

.detail-desc {
  color: var(--dark-3);
  font-size: 1.05rem;
  line-height: 1.7;
}

.brand-item {
  background: var(--light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  border: 1px solid rgba(0,0,0,0.04);
}

.brand-item span {
  font-family: 'Outfit';
  font-size: 0.95rem;
}

.detail-image-wrapper {
  position: relative;
  display: inline-block;
}

.detail-glow-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(22, 163, 74, 0.08) 0%, rgba(22, 163, 74, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

.detail-product-img {
  transition: var(--transition);
}

.detail-image-wrapper:hover .detail-product-img {
  transform: scale(1.05) translateY(-5px);
}

/* ---- Brands Marquee ---- */
.brands-marquee {
  overflow: hidden;
  width: 100%;
  position: relative;
}

.brands-marquee::before,
.brands-marquee::after {
  content: "";
  position: absolute;
  top: 0;
  width: 100px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.brands-marquee::before {
  left: 0;
  background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
}

.brands-marquee::after {
  right: 0;
  background: linear-gradient(-90deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
}

.brands-track {
  display: flex;
  width: calc(160px * 14);
  animation: scrollMarquee 35s linear infinite;
  gap: 40px;
}

.brand-slide {
  width: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
}

@keyframes scrollMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-160px * 7 - 280px)); }
}

/* ---- Projects Slider ---- */
.project-card {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  height: 320px;
  cursor: pointer;
}

.project-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.project-carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease-in-out, transform 8s ease-in-out;
}

.project-carousel img.active {
  opacity: 1;
  transform: scale(1.04);
}

.project-card:hover .project-carousel img.active {
  transform: scale(1.08);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(15, 23, 42, 0.9) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  z-index: 10;
  transition: var(--transition);
}

.project-card:hover .project-overlay {
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.15) 0%, rgba(15, 23, 42, 0.95) 100%);
}

.project-tag {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 8px;
  width: fit-content;
}

.project-overlay h4 {
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.project-overlay p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  margin: 0;
}

/* Visibility classes */
.project-item-hidden {
  display: none !important;
}

/* ---- Process / Steps ---- */
.process-step {
  text-align: center;
  position: relative;
  padding: 40px 20px;
}

.step-number {
  width: 64px;
  height: 64px;
  background: var(--gradient-solar);
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.process-step h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.process-step p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ---- Testimoniales ---- */
.testimonial-card {
  background: #ffffff;
  padding: 40px 32px;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.testimonial-stars {
  color: #fbbf24;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.testimonial-text {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 16px;
}

.testimonial-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.08);
  color: var(--primary);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.testimonial-author h6 {
  font-weight: 700;
  margin: 0;
  font-size: 0.95rem;
}

.testimonial-author small {
  color: var(--text-secondary);
}

/* ---- Misión / Visión / Valores ---- */
.valores-section {
  background: var(--dark);
  position: relative;
  overflow: hidden;
}

/* Faint background texture */
.valores-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 0% 50%, rgba(22, 163, 74, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 50%, rgba(14, 165, 233, 0.05) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* Large decorative number watermark */
.valores-bg-number {
  position: absolute;
  top: 50%;
  left: -0.15em;
  transform: translateY(-50%);
  font-family: 'Outfit', sans-serif;
  font-size: clamp(8rem, 22vw, 18rem);
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.025);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  letter-spacing: -0.05em;
}

/* Override section-header for dark bg */
.valores-section .section-title {
  color: #ffffff;
}
.valores-section .section-subtitle {
  color: rgba(255, 255, 255, 0.55);
}

/* Cards */
.valor-card {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-lg);
  padding: 40px 32px 36px;
  height: 100%;
  transition: var(--transition);
  overflow: hidden;
  z-index: 1;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.valor-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(22, 163, 74, 0.25);
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(22, 163, 74, 0.2);
}

/* Top green accent bar */
.valor-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-solar);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transform: scaleX(0.35);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.valor-card:hover .valor-card-accent {
  transform: scaleX(1);
}

/* Featured (Visión) card */
.valor-card--featured {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.22);
}
.valor-card--featured .valor-card-accent {
  transform: scaleX(1);
}
.valor-card--featured:hover {
  background: rgba(22, 163, 74, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), var(--shadow-glow);
}

/* Icon + number row */
.valor-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.valor-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.25);
  color: var(--primary-light);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.valor-card:hover .valor-icon,
.valor-card--featured .valor-icon {
  background: var(--gradient-solar);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

.valor-label {
  font-family: 'Outfit', sans-serif;
  font-size: 2.4rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.06);
  line-height: 1;
  letter-spacing: -2px;
  transition: color 0.4s ease;
}

.valor-card:hover .valor-label {
  color: rgba(22, 163, 74, 0.18);
}

/* Title */
.valor-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}

/* Text */
.valor-text {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.95rem;
  line-height: 1.8;
  margin: 0;
}

/* Values list */
.valor-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.valor-list li {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.3s;
}

.valor-list li:hover {
  color: #ffffff;
}

.valor-list li i {
  color: var(--primary-light);
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .valores-bg-number { font-size: clamp(6rem, 28vw, 10rem); }
  .valor-card { padding: 28px 20px; }
  .valor-label { font-size: 1.8rem; }
}

/* ---- CTA Section ---- */

.cta-section {
  background: var(--gradient-solar);
  color: #fff;
  text-align: center;
}

.cta-content h2 {
  color: #fff;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.cta-content p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.15rem;
  margin-bottom: 30px;
}

/* ---- Contact Section ---- */
.contact-info-card {
  display: flex;
  align-items: center;
  background: #ffffff;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 16px;
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(22, 163, 74, 0.08);
  color: var(--primary);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
}

.contact-info-card h5 {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.contact-info-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.contact-form .form-control {
  background: var(--light);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  color: var(--dark);
  transition: var(--transition);
  height: auto;
}

.contact-form .form-control:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
  outline: none;
}

.contact-form textarea.form-control {
  min-height: 120px;
}

/* ---- Footer ---- */
.footer {
  background: var(--dark);
  padding: 80px 0 30px;
  color: rgba(255, 255, 255, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer h5 {
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 24px;
  font-size: 1.15rem;
}

.footer p {
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  text-decoration: none !important;
}

.footer-social a:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none !important;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary-light);
  padding-left: 4px;
}

.footer-bottom {
  text-align: center;
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
}

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: -60px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-solar);
  color: #ffffff;
  border: none;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  outline: none !important;
}

.back-to-top.visible {
  right: 30px;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

/* ---- WhatsApp Float ---- */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #25D366;
  color: #ffffff;
  border: none;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: right 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none !important;
  font-size: 1.8rem;
}

.whatsapp-float:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(37, 211, 102, 0.4);
  color: #ffffff;
}

.back-to-top.visible + .whatsapp-float {
  right: 88px;
}

/* ============================================
   INFOGRAFÍA INTERACTIVA
   ============================================ */

.sistema-autonomo-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: visible;
  margin-top: 60px; /* space for the sun above */
}

.autonomo-main-img {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* ---- Animated Sun ---- */
.infra-sun {
  position: absolute;
  top: -55px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  filter: drop-shadow(0 0 18px rgba(251,191,36,0.7));
  animation: sunFloat 4s ease-in-out infinite;
}

@keyframes sunFloat {
  0%, 100% { transform: translateX(-50%) translateY(0px); }
  50%       { transform: translateX(-50%) translateY(-10px); }
}

.sun-rays {
  transform-origin: 50px 50px;
  animation: sunRotate 14s linear infinite;
}
@keyframes sunRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.sun-core {
  animation: sunPulse 2.5s ease-in-out infinite;
}
@keyframes sunPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

/* ---- Energy flow SVG ---- */
.energy-flow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.energy-path {
  animation: flowDash 2s linear infinite;
}
@keyframes flowDash {
  from { stroke-dashoffset: 52; }
  to   { stroke-dashoffset: 0; }
}

/* ---- Hotspots ---- */
.autonomo-hotspot {
  position: absolute;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 20;
}

.hotspot-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid var(--primary);
  animation: hotspotPing 2s ease-out infinite;
}
@keyframes hotspotPing {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.hotspot-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(22,163,74,0.45);
  transition: var(--transition);
  z-index: 2;
}
.autonomo-hotspot:hover .hotspot-number {
  background: var(--primary-dark);
  transform: scale(1.12);
}

/* ---- Inline tooltips (positioned near each hotspot) ---- */
.autonomo-tooltip-inline {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 220px;
  background: var(--dark);
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  border: 1px solid rgba(22,163,74,0.35);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  z-index: 100;
}
/* Arrow up */
.autonomo-tooltip-inline::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border: 8px solid transparent;
  border-top: none;
  border-bottom-color: var(--dark);
}

/* ABOVE variant – for bottom hotspots */
.autonomo-tooltip-inline.tooltip-above {
  top: auto;
  bottom: calc(100% + 14px);
  transform: translateX(-50%) translateY(-8px);
}
.autonomo-tooltip-inline.tooltip-above::before {
  top: auto;
  bottom: -8px;
  border-top-color: var(--dark);
  border-bottom-color: transparent;
  border-top-width: 8px;
  border-bottom-width: 0;
}

/* LEFT variant – for rightmost hotspot */
.autonomo-tooltip-inline.tooltip-left {
  left: auto;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
}
.autonomo-tooltip-inline.tooltip-left::before {
  top: 50%;
  left: auto;
  right: -8px;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-right: none;
  border-left-color: var(--dark);
  border-left-width: 8px;
}

/* Show on hover */
.autonomo-hotspot:hover .autonomo-tooltip-inline {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.autonomo-hotspot:hover .autonomo-tooltip-inline.tooltip-above {
  transform: translateX(-50%) translateY(0);
}
.autonomo-hotspot:hover .autonomo-tooltip-inline.tooltip-left {
  transform: translateY(-50%) translateX(0);
}

/* Tooltip inner styles */
.autonomo-tooltip-inline .tooltip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.autonomo-tooltip-inline .tooltip-num {
  width: 22px;
  height: 22px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
  font-family: 'Outfit', sans-serif;
}
.autonomo-tooltip-inline .tooltip-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
}
.autonomo-tooltip-inline .tooltip-desc {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.72);
  margin: 0;
  line-height: 1.5;
}

/* ============================================
   VIDEO CARDS
   ============================================ */

.video-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 6px 32px rgba(0,0,0,0.08);
  border: 1px solid rgba(22,163,74,0.12);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.14), 0 0 0 2px rgba(22,163,74,0.25);
}

/* Thumbnail area */
.video-card-thumb {
  position: relative;
  height: 260px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  flex-shrink: 0;
}

.video-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,20,10,0.25) 0%,
    rgba(10,20,10,0.65) 100%
  );
  transition: var(--transition);
}

.video-card:hover .video-card-overlay {
  background: linear-gradient(
    to bottom,
    rgba(10,20,10,0.35) 0%,
    rgba(10,20,10,0.75) 100%
  );
}

/* Badge top-left */
.video-card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(22,163,74,0.88);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 5px 12px;
  border-radius: 50px;
  backdrop-filter: blur(4px);
  z-index: 2;
}

/* Duration chip bottom-right */
.video-card-duration {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  z-index: 2;
  font-family: 'Outfit', sans-serif;
}

/* Play button centered */
.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 62px;
  height: 62px;
  background: rgba(255,255,255,0.15);
  border: 2.5px solid rgba(255,255,255,0.8);
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: background 0.25s ease, transform 0.25s ease;
  backdrop-filter: blur(4px);
  padding-left: 4px; /* optical center for play icon */
}

.video-play-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Pulsing ring around play */
.play-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  animation: playRingPulse 2s ease-out infinite;
}
@keyframes playRingPulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* Body below thumb */
.video-card-body {
  padding: 24px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-card-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--dark);
  margin: 0;
  line-height: 1.35;
}

.video-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
  flex: 1;
}

.video-card-cta {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  background: var(--gradient-solar);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 9px 22px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  /* override absolute positioning from .video-play-btn */
  position: static;
  transform: none;
  top: auto; left: auto;
  width: auto; height: auto;
  backdrop-filter: none;
}
.video-card-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(22,163,74,0.35);
}

/* Inline video player */
.video-card-player {
  position: relative;
  background: #000;
}
.video-card-player video {
  display: block;
  max-height: 320px;
  object-fit: contain;
}
.video-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 5;
}
.video-close-btn:hover {
  background: var(--primary);
}

/* ============================================
   PRODUCT GRID CARDS
   ============================================ */


.products-section {
  background: #f8fafc;
  position: relative;
}

.sun-backdrop {
  position: absolute;
  top: -120px;
  right: -120px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(22,163,74,0.07) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* --- Card base --- */
.product-grid-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  height: 280px;
  transition: var(--transition);
  border: 2px solid transparent;
}

.product-grid-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}

.product-grid-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22,163,74,0.2), 0 20px 50px rgba(0,0,0,0.18);
  transform: translateY(-4px);
}

/* --- Background image fills the card --- */
.product-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}

.product-grid-card:hover .product-card-bg {
  transform: scale(1.06);
}

/* --- Dark gradient overlay --- */
.product-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 20, 10, 0.88) 0%,
    rgba(10, 20, 10, 0.45) 55%,
    rgba(10, 20, 10, 0.10) 100%
  );
  display: flex;
  align-items: flex-end;
  padding: 22px;
  transition: var(--transition);
}

/* overlay stays dark when active — no green overlay */

/* --- Text inside card --- */
.product-card-content {
  width: 100%;
}

.product-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(22,163,74,0.85);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 10px;
  backdrop-filter: blur(4px);
}

.product-card-title {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.2;
  font-family: 'Outfit', sans-serif;
}

.product-card-action {
  display: inline-flex;
  align-items: center;
  color: var(--primary-light);
  font-size: 0.88rem;
  font-weight: 600;
  gap: 6px;
  transition: var(--transition);
}

.product-grid-card:hover .product-card-action,
.product-grid-card.active .product-card-action {
  color: #ffffff;
  gap: 10px;
}

/* ============================================
   COLLAPSIBLE DETAIL PANELS
   ============================================ */

.product-details-container {
  width: 100%;
}

/* --- Hidden by default, shown when .active --- */
.product-detail-panel {
  display: none;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
  border: 1px solid rgba(22,163,74,0.15);
  border-left: 4px solid var(--primary);
  animation: panelSlideDown 0.35s ease forwards;
}

.product-detail-panel.active {
  display: block;
}

@keyframes panelSlideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Text inside the panel --- */
.detail-title {
  color: var(--dark);
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
}

.detail-desc {
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: 1rem;
  margin-bottom: 0;
}

/* --- Brand chips inside panel --- */
.brand-item {
  background: var(--light);
  border: 1px solid var(--light-2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: var(--transition);
}

.brand-item:hover {
  border-color: var(--primary);
  background: rgba(22,163,74,0.05);
}

/* --- Glowing image area --- */
.detail-image-wrapper {
  position: relative;
  display: inline-block;
}

.detail-glow-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(22,163,74,0.18) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.detail-product-img {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.12));
  transition: transform 0.5s ease;
}

.detail-product-img:hover {
  transform: scale(1.04) translateY(-4px);
}

/* ---- Project items hidden state (show more) ---- */
.project-item-hidden {
  display: none !important;
}

/* ============================================
   PROJECT CARDS  (same style as product cards)
   ============================================ */

.project-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 280px;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid var(--primary);
  background: var(--dark);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.22), 0 0 0 3px rgba(22,163,74,0.3);
}

/* Background layer (static or carousel) */
.project-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}

.project-card:hover .project-card-bg {
  transform: scale(1.06);
}

/* Carousel images inside .project-card-bg */
.project-card-bg.project-carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.project-card-bg.project-carousel img.active {
  opacity: 1;
}

/* Dark gradient overlay */
.project-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 20, 10, 0.90) 0%,
    rgba(10, 20, 10, 0.40) 55%,
    rgba(10, 20, 10, 0.08) 100%
  );
  display: flex;
  align-items: flex-end;
  padding: 22px;
  transition: var(--transition);
}

.project-card:hover .project-card-overlay {
  background: linear-gradient(
    to top,
    rgba(10, 20, 10, 0.95) 0%,
    rgba(10, 20, 10, 0.50) 60%,
    rgba(10, 20, 10, 0.10) 100%
  );
}

/* Content group */
.project-card-content {
  width: 100%;
}

/* Tag pill */
.project-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(22,163,74,0.85);
  color: #fff;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 8px;
  backdrop-filter: blur(4px);
}

/* Title */
.project-card-title {
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1.25;
  font-family: 'Outfit', sans-serif;
}

/* Spec line */
.project-card-spec {
  color: rgba(255,255,255,0.70);
  font-size: 0.82rem;
  margin: 0;
  line-height: 1.4;
}

/* ============================================
   PRODUCT MODAL
   ============================================ */

/* Backdrop */
.product-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 15, 0.72);
  backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.product-modal-backdrop.open {
  display: flex;
  animation: backdropFadeIn 0.25s ease forwards;
}

@keyframes backdropFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Modal container */
.product-modal {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
  animation: modalSlideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Close button */
.product-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #ffffff;
  transition: var(--transition);
  z-index: 10;
  backdrop-filter: blur(4px);
}

.product-modal-close:hover {
  background: var(--primary);
  transform: rotate(90deg);
}

/* Modal header image banner */
.product-modal-banner {
  width: 100%;
  height: 240px;
  background-size: cover;
  background-position: center;
  border-radius: 24px 24px 0 0;
  position: relative;
  flex-shrink: 0;
}

.product-modal-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.05) 0%,
    rgba(15,23,42,0.78) 100%
  );
  border-radius: 24px 24px 0 0;
  z-index: 1;
}

.modal-bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  border-radius: 24px 24px 0 0;
}

.product-modal-banner-content {
  position: absolute;
  bottom: 28px;
  left: 36px;
  z-index: 2;
}

.product-modal-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(22,163,74,0.88);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 14px;
  border-radius: 50px;
  margin-bottom: 10px;
  backdrop-filter: blur(4px);
}

.product-modal-title {
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}

/* Modal body */
.product-modal-body {
  padding: 36px 40px 40px;
  max-height: 60vh;
  overflow-y: auto;
}

/* Efecto Blur para el fondo oscuro del modal */
.modal-backdrop.show {
  opacity: 1;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.product-modal-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 28px;
}

.product-modal-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 16px;
}

.product-modal-brands {
  margin-bottom: 32px;
  /* Ocultar antes de inicializar para evitar FOUC */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease-in-out;
}

/* Mostrar suavemente cuando Slick está listo */
.product-modal-brands.slick-initialized {
  opacity: 1;
  visibility: visible;
}

.product-modal-brand-chip {
  background: var(--light);
  border: 1.5px solid var(--light-2);
  border-radius: 10px;
  padding: 12px 18px;
  transition: var(--transition);
  margin: 0 6px; /* Para separar los slides de slick */
}

.product-modal-brand-chip:hover {
  border-color: var(--primary);
  background: rgba(22,163,74,0.05);
}

.product-modal-brand-chip strong {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  color: var(--dark);
}

.product-modal-brand-chip small {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Footer CTA inside modal */
.product-modal-footer {
  border-top: 1px solid var(--light-2);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.product-modal-footer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Scrollbar inside modal */
.product-modal-body::-webkit-scrollbar { width: 6px; }
.product-modal-body::-webkit-scrollbar-track { background: transparent; }
.product-modal-body::-webkit-scrollbar-thumb { background: var(--light-2); border-radius: 3px; }

@media (max-width: 576px) {
  .product-modal-body { padding: 24px 20px 28px; }
  .product-modal-title { font-size: 1.5rem; }
  .product-modal-banner { height: 180px; }
  .product-modal-banner-content { left: 20px; bottom: 18px; }
  
  /* Acomodar el footer y botón en móvil */
  .product-modal-footer {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  .product-modal-footer .btn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ============================================ */

/* ---- UNIVERSAL OVERFLOW FIX (applies to all sizes, critical on mobile) ---- */
/* Bootstrap 4 .row uses negative margins that cause horizontal scroll        */
.container,
.container-fluid {
  padding-right: 15px;
  padding-left: 15px;
}

@media (max-width: 768px) {
  /* Clamp Bootstrap rows so their negative margins don't overflow viewport */
  .row {
    margin-right: 0;
    margin-left: 0;
  }
  .row > [class*="col-"] {
    padding-right: 12px;
    padding-left: 12px;
  }

  /* Hero: keep content inside viewport */
  .hero-content {
    max-width: 100%;
    padding-right: 0;
  }
  .hero-title,
  .hero-subtitle {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Prevent the hero background from causing overflow */
  .hero-bg,
  .hero-overlay,
  .hero-particles {
    max-width: 100vw;
    overflow: hidden;
  }

  /* General safeguard: nothing wider than viewport */
  section,
  header,
  footer,
  .navbar-custom {
    max-width: 100vw;
    overflow-x: hidden;
  }
}

/* ---- Tablet (max 992px) ---- */
@media (max-width: 992px) {


  /* Sections */
  .section-padding { padding: 70px 0; }
  .section-title { font-size: 2.1rem; }

  /* Hero */
  .hero-section { padding-top: 100px; }
  .hero-title { font-size: 2.8rem; }
  .hero-stats { gap: 24px; }

  /* Infografía */
  .sistema-autonomo-wrapper { margin-top: 40px; }

  /* Navbar */
  .navbar-custom { padding: 14px 0; }
  .navbar-collapse {
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .navbar-custom .nav-link {
    padding: 10px 16px !important;
    border-radius: 8px;
  }
  .navbar-custom .nav-link:hover {
    background: rgba(22, 163, 74, 0.1);
  }
  .navbar-custom .ml-lg-3 {
    margin-top: 8px;
    display: block;
  }
  .navbar-custom .btn-cta {
    display: inline-flex;
    width: auto;
  }

  /* Products grid */
  .product-grid-card { height: 240px; }

  /* Detail panels */
  .product-detail-panel.active { padding: 28px 24px; }
  .detail-title { font-size: 1.5rem; }

  /* Footer */
  .footer { padding: 60px 0 24px; }

  /* CTA */
  .cta-content h2 { font-size: 2rem; }
}

/* ---- Mobile (max 768px) ---- */
@media (max-width: 768px) {

  /* Sections */
  .section-padding { padding: 55px 0; }
  .section-header { margin-bottom: 40px; }
  .section-title { font-size: 1.85rem; }
  .section-subtitle { font-size: 1rem; }

  /* Hero */
  .hero-section {
    padding-top: 90px;
    min-height: 100svh;
  }
  .hero-title { font-size: 2.1rem; line-height: 1.2; }
  .hero-subtitle { font-size: 1rem; margin-bottom: 28px; }
  .hero-badge { font-size: 0.78rem; }
  .hero-buttons {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 36px;
  }
  .hero-buttons .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .hero-stats {
    gap: 0;
    flex-wrap: wrap;
    justify-content: space-around;
    padding-top: 20px;
  }
  .hero-stat {
    text-align: center;
    padding: 10px 8px;
    min-width: 90px;
  }
  .hero-stat .number { font-size: 1.6rem; }
  .hero-stat .label { font-size: 0.75rem; }

  /* Infografía autónoma: hide the absolute hotspots on very small screens
     and show a simpler list instead */
  .sistema-autonomo-wrapper {
    margin-top: 30px;
    padding: 16px;
  }
  .autonomo-hotspot {
    width: 34px;
    height: 34px;
  }
  .hotspot-number { font-size: 0.82rem; }
  /* Tooltip: switch all to bottom-center and allow scroll */
  .autonomo-tooltip-inline {
    width: 180px;
    font-size: 0.76rem;
    padding: 10px 12px;
  }
  /* Right-side hotspot tooltip: avoid going off-screen */
  .autonomo-tooltip-inline.tooltip-left {
    left: auto;
    right: auto;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    border-top: none;
    border-bottom-color: var(--dark);
  }
  .autonomo-tooltip-inline.tooltip-left::before {
    right: auto;
    left: 50%;
    top: -8px;
    bottom: auto;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top: none;
    border-bottom-color: var(--dark);
    border-left: none;
  }
  .autonomo-hotspot:hover .autonomo-tooltip-inline.tooltip-left {
    transform: translateX(-50%) translateY(0);
  }

  /* Services */
  .service-card { padding: 28px 20px; }

  /* Products */
  .product-grid-card { height: 200px; }
  .product-detail-panel.active { padding: 20px 16px; }
  .detail-title { font-size: 1.35rem; }
  .detail-desc { font-size: 0.9rem; }

  /* Nosotros */
  .nosotros-img-wrapper img { height: 280px !important; }

  /* Project cards */
  .project-card { height: 240px; }

  /* Process steps */
  .process-step { padding: 24px 14px; }

  /* Testimonials */
  .testimonial-card { padding: 28px 20px; }

  /* Contact */
  .contact-info-card { padding: 18px; }
  .contact-icon { margin-right: 14px; }

  /* CTA */
  .cta-content h2 { font-size: 1.7rem; }
  .cta-content p { font-size: 1rem; }
  .cta-content .btn { width: 100%; justify-content: center; }

  /* Footer */
  .footer { padding: 48px 0 20px; }
  .footer-bottom { margin-top: 32px; padding-top: 20px; }

  /* Back to top & WhatsApp */
  .back-to-top.visible { right: 16px; bottom: 16px; }
  .whatsapp-float { right: 16px; bottom: 16px; }
  .back-to-top.visible + .whatsapp-float { right: 74px; }

  /* Brands marquee: smaller */
  .brand-slide { width: 120px; }
  .brands-track {
    width: calc(120px * 14);
    gap: 24px;
  }
  @keyframes scrollMarquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(calc(-120px * 7 - 168px)); }
  }

  /* Video cards */
  .video-card-thumb { height: 180px; }
  .video-play-btn { width: 50px; height: 50px; font-size: 0.9rem; }

  /* Energy flow SVG: hide on mobile (complex to scale) */
  .energy-flow-svg { display: none; }
}

/* ---- Small Mobile (max 576px) ---- */
@media (max-width: 576px) {

  /* Hero */
  .hero-title { font-size: 1.75rem; }
  .hero-subtitle { font-size: 0.93rem; }

  /* Section titles */
  .section-title { font-size: 1.65rem; }

  /* Infografía: make hotspots smaller and simplify */
  .autonomo-hotspot { width: 28px; height: 28px; }
  .hotspot-number { font-size: 0.72rem; }
  .autonomo-tooltip-inline { width: 160px; font-size: 0.72rem; }

  /* Product cards narrower */
  .product-grid-card { height: 190px; }
  .product-card-title { font-size: 1.05rem; }

  /* Detail panels */
  .product-detail-panel.active { padding: 16px 12px; }

  /* Modal tweaks already defined above – kept here for clarity */
  .product-modal { border-radius: 16px; }

  /* Contact form: stack columns */
  .contact-form .row > [class*="col-md"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* CTA */
  .cta-content h2 { font-size: 1.5rem; }
  .cta-section.section-padding { padding: 48px 0; }

  /* Footer column ordering — description first */
  .footer .col-lg-4 { order: 0; }
  .footer .col-lg-2,
  .footer .col-lg-3 { order: 1; }

  /* Nosotros badge */
  .nosotros-img-wrapper img { height: 220px !important; }
  .nosotros-img-wrapper > div {
    padding: 12px 16px !important;
  }
  .nosotros-img-wrapper > div > div:first-child {
    font-size: 1.6rem !important;
  }

  /* Benefit cards */
  .benefit-card { padding: 24px 18px; }

  /* Process */
  .step-number { width: 52px; height: 52px; font-size: 1.2rem; }
  .process-step h4 { font-size: 1.05rem; }

  /* Testimonials */
  .testimonial-card { padding: 24px 16px; }

  /* Remove hover lift effects on mobile (performance) */
  .service-card:hover,
  .benefit-card:hover,
  .product-grid-card:hover,
  .project-card:hover,
  .video-card:hover {
    transform: none;
  }

  /* Back to top */
  .back-to-top { width: 42px; height: 42px; }
}

/* ---- Extra small (max 400px) ---- */
@media (max-width: 400px) {
  .hero-title { font-size: 1.55rem; }
  .hero-stat .number { font-size: 1.4rem; }

  .navbar-brand .navbar-logo { height: 36px !important; }

  .btn { padding: 10px 20px; font-size: 0.9rem; }
  .btn-cta { padding: 8px 18px; font-size: 0.85rem; }

  .section-title { font-size: 1.5rem; }

  /* Infografía: hide hotspot tooltips completely, show legend below */
  .autonomo-tooltip-inline { display: none; }

  /* CTA */
  .cta-content h2 { font-size: 1.35rem; }
}

/* ---- Landscape phone ---- */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-section { min-height: auto; padding: 100px 0 60px; }
  .hero-title { font-size: 1.8rem; }
  .hero-subtitle { margin-bottom: 18px; }
  .hero-buttons { flex-direction: row; }
  .hero-buttons .btn { width: auto; }
}

/* ---- Touch / hover fix: disable CSS hover on touch devices ---- */
@media (hover: none) and (pointer: coarse) {
  .service-card:hover,
  .benefit-card:hover,
  .product-grid-card:hover,
  .project-card:hover,
  .video-card:hover,
  .btn-solar:hover,
  .btn-cta:hover,
  .btn-outline-light-custom:hover {
    transform: none;
    box-shadow: none;
  }
  .btn-solar:hover { box-shadow: 0 4px 15px rgba(22, 163, 74, 0.2); }
}

/* ============================================
   HERO BACKGROUND SLIDER (HBS)
   ============================================ */

/* Remove old static .hero-bg since slides replace it */
.hero-bg { display: none !important; }

/* Slide track — fills the whole hero */
.hbs-track {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

/* Each slide */
.hbs-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.6s cubic-bezier(0.4, 0, 0.2, 1);
  animation: hbsKenBurns 14s ease-in-out infinite alternate;
  will-change: opacity, transform;
}

/* Stagger Ken Burns per slide so each zooms slightly differently */
.hbs-slide:nth-child(odd)  { animation-name: hbsKenBurnsA; }
.hbs-slide:nth-child(even) { animation-name: hbsKenBurnsB; }

.hbs-slide.active {
  opacity: 1;
  z-index: 2;
}

@keyframes hbsKenBurnsA {
  0%   { transform: scale(1)    translate(0, 0); }
  50%  { transform: scale(1.07) translate(-1%, -0.5%); }
  100% { transform: scale(1.04) translate(0.5%, 1%); }
}
@keyframes hbsKenBurnsB {
  0%   { transform: scale(1.04) translate(0.5%, 0); }
  50%  { transform: scale(1.08) translate(-0.5%, 1%); }
  100% { transform: scale(1)    translate(0, 0); }
}

/* Override gradient overlay so it works on top of the slider */
.hero-section .hero-overlay {
  z-index: 3;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.82) 0%,
    rgba(15, 23, 42, 0.68) 50%,
    rgba(15, 23, 42, 0.45) 100%
  );
}

.hero-section .hero-particles { z-index: 4; }
.hero-section .container       { position: relative; z-index: 5; }

/* ---- Thumbnail strip ---- */
.hbs-thumbs {
  position: absolute;
  bottom: 80px;   /* sits above the progress bar */
  right: 36px;
  display: flex;
  flex-direction: row;
  gap: 8px;
  z-index: 10;
  align-items: flex-end;
}

.hbs-thumb {
  width: 64px;
  height: 42px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  opacity: 0.45;
  border: 2px solid transparent;
  transition: all 0.4s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.hbs-thumb:hover {
  opacity: 0.85;
  transform: translateY(-4px) scale(1.05);
}

.hbs-thumb.active {
  opacity: 1;
  border-color: var(--primary-light);
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.55);
  transform: translateY(-5px) scale(1.08);
}

/* ---- Progress bar ---- */
.hbs-progress-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 10;
}

.hbs-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--gradient-solar);
  will-change: width;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hbs-thumbs {
    bottom: 70px;
    right: 12px;
    gap: 6px;
  }
  .hbs-thumb {
    width: 48px;
    height: 32px;
    border-radius: 6px;
  }
}

@media (max-width: 480px) {
  .hbs-thumbs { display: none; } /* too tight on very small screens */
}

/* ---- Fix: Typed text layout shift (brinco) ----
   Reserve the width of the longest word ("Residencial") so the
   paragraph never reflows while letters are typed or deleted.      */
.typed-text {
  display: inline-block;
  min-width: 7.8em;          /* approx. width of "Residencial" at current font */
  vertical-align: bottom;    /* keeps baseline aligned with surrounding text   */
  white-space: nowrap;       /* prevents the typed word from wrapping itself   */
}

.typed-cursor {
  display: inline-block;
  vertical-align: bottom;
  line-height: 1;
}