:root {
  --green-primary: #085038;
  --green-dark: #042e20;
  --green-light: #e8f3ef;
  --yellow-lightning: #ffd700;
  
  --bg-white: #ffffff;
  --bg-light: #f8faf9;
  
  --text-dark: #121926;
  --text-muted: #52645d;
  --border-color: rgba(8, 80, 56, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  background-color: var(--bg-white);
  color: var(--text-dark);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* PRELOADER */
#preloader {
  position: fixed;
  inset: 0;
  background-color: var(--bg-white);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-content { text-align: center; }

.lightning-icon {
  width: 80px;
  height: 80px;
  color: var(--yellow-lightning);
  filter: drop-shadow(0 0 15px var(--yellow-lightning));
  animation: pulse 0.8s infinite alternate, flicker 0.15s infinite;
}

#preloader p {
  margin-top: 1rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--green-primary);
  font-size: 0.9rem;
}

/* EFECTO PERSIANA CON RAYO */
#lightning-curtain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  display: none;
  justify-content: center;
  align-items: center;
}

#lightning-curtain.active-transition {
  display: flex;
}

.single-blind {
  position: absolute;
  inset: 0;
  background-color: var(--green-dark);
  border-right: 4px solid var(--yellow-lightning);
  transform: scaleX(0);
  transform-origin: left;
  box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}

.center-lightning-bolt {
  position: relative;
  z-index: 10;
  width: 130px;
  height: 130px;
  color: var(--yellow-lightning);
  opacity: 0;
  transform: scale(0.5);
}

.center-lightning-bolt svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 35px var(--yellow-lightning)) drop-shadow(0 0 10px #ffffff);
}

#lightning-curtain.wipe-animation .single-blind {
  animation: singleBlindSlide 2s cubic-bezier(0.7, 0, 0.2, 1) forwards;
}

#lightning-curtain.wipe-animation .center-lightning-bolt {
  animation: lightningPop 2s ease-in-out forwards;
}

@keyframes singleBlindSlide {
  0% { transform: scaleX(0); transform-origin: left; }
  45% { transform: scaleX(1); transform-origin: left; }
  55% { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

@keyframes lightningPop {
  0% { opacity: 0; transform: scale(0.3) rotate(-10deg); }
  40% { opacity: 1; transform: scale(1.35) rotate(0deg); }
  60% { opacity: 1; transform: scale(1.15) rotate(5deg); }
  100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
}

/* LAYOUT PRINCIPAL */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.left-panel {
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--green-dark);
  position: relative;
  overflow-y: auto;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-container.section-active .left-panel {
  width: 75%;
}

.section-padding {
  padding: 2rem 2.5rem;
}

.full-screen-view {
  width: 100%;
  height: 100%;
}

/* FONDOS */
.bg-video-section, .bg-image-section {
  position: relative;
  min-height: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.bg-nosotros {
  background-image: url('imagenes/instalacionelectrica.jpeg');
}

.bg-contacto {
  background-image: url('imagenes/Grua1.jpeg');
}

.bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.section-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 46, 32, 0.82);
  z-index: 2;
}

.section-content-wrapper {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.bg-video-section .section-title, .bg-image-section .section-title { color: #ffffff; }
.bg-video-section .lead-text, .bg-image-section .lead-text { color: #f0f0f0; }

.bg-video-section .stat-card, 
.bg-image-section .stat-card,
.bg-video-section .service-card,
.bg-video-section .client-card,
.bg-image-section .contact-form,
.bg-image-section .contact-item {
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-dark);
  backdrop-filter: blur(4px);
}

/* LOGO INTEGRADO */
.section-brand-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  width: fit-content;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.section-brand-header:hover { transform: translateY(-2px); }
.section-brand-logo { height: 35px; width: auto; }
.section-brand-text { display: flex; flex-direction: column; }
.section-brand-title { font-weight: 900; font-size: 1.1rem; color: var(--green-primary); line-height: 1; }
.section-brand-sub { font-size: 0.55rem; font-weight: 700; color: var(--text-muted); letter-spacing: 1px; }

/* INICIO BANNER */
.hero-banner.full-hero {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.banner-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.banner-slide.slide-1 { background-image: url('imagenes/estacion2.jpeg'); }
.banner-slide.slide-2 { background-image: url('imagenes/centrodistribucion2.jpeg'); }
.banner-slide.slide-3 { background-image: url('imagenes/posteelectrico.jpeg'); }
.banner-slide.active { opacity: 1; }

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0.92) 100%);
}

.hero-brand {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  max-width: 650px;
}

.brand-logo-large { max-width: 240px; height: auto; margin-bottom: 0.8rem; }
.hero-title { font-size: 3rem; font-weight: 900; color: var(--green-primary); letter-spacing: 3px; line-height: 1; }
.hero-subtitle { font-size: 0.8rem; font-weight: 800; color: var(--text-dark); letter-spacing: 3px; margin-top: 6px; margin-bottom: 1.2rem; }
.hero-description { font-size: 1rem; color: var(--text-muted); line-height: 1.5; }

/* VISTAS */
.content-view {
  display: none;
  min-height: 100%;
  animation: fadeIn 0.4s ease forwards;
}
.content-view.active-view { display: block; }

.section-title {
  font-size: 1.8rem;
  color: var(--green-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 3px solid var(--yellow-lightning);
  padding-bottom: 0.4rem;
}

.lead-text { font-size: 1rem; line-height: 1.5; margin-bottom: 1.2rem; color: var(--text-dark); }

.stats-grid { display: flex; gap: 1rem; margin-top: 1.5rem; }
.stat-card { border: 1px solid var(--border-color); padding: 1.2rem; border-radius: 12px; flex: 1; text-align: center; }
.stat-number { display: block; font-size: 2rem; font-weight: 900; color: var(--green-primary); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.service-card { border: 1px solid var(--border-color); padding: 1.1rem; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); transition: transform 0.3s ease; }
.service-card:hover { transform: translateY(-3px); border-color: var(--green-primary); }
.service-card.full-span { grid-column: span 2; }
.service-icon { font-size: 1.5rem; color: var(--green-primary); background: var(--green-light); width: 42px; height: 42px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 0.6rem; }
.service-card h3 { font-size: 1rem; margin-bottom: 0.4rem; color: var(--green-primary); }
.service-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

.clients-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 0.8rem; }
.client-card { border: 1px solid var(--border-color); border-radius: 12px; padding: 1.2rem; display: flex; align-items: center; justify-content: center; }
.client-card img { max-width: 100%; height: auto; filter: grayscale(100%); opacity: 0.8; transition: all 0.3s ease; }
.client-card:hover img { filter: grayscale(0%); opacity: 1; }

.contact-container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.5rem; }
.contact-form { padding: 1.2rem; border-radius: 12px; border: 1px solid var(--border-color); }
.contact-form h3 { margin-bottom: 0.8rem; color: var(--green-primary); font-size: 1.1rem; }
.form-group { margin-bottom: 0.8rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.3rem; }
.form-group input, .form-group textarea { width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--border-color); border-radius: 6px; outline: none; }
.btn-submit { width: 100%; background: var(--green-primary); color: #ffffff; border: none; padding: 0.8rem; border-radius: 6px; font-weight: 800; cursor: pointer; }
.contact-info-cards { display: flex; flex-direction: column; gap: 0.8rem; }
.contact-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 10px; border: 1px solid var(--border-color); }
.contact-item i { font-size: 1.5rem; color: var(--green-primary); }

/* PANEL DERECHO */
.right-panel {
  width: 50%;
  height: 100%;
  background-color: var(--bg-white);
  border-left: 1px solid var(--border-color);
  display: flex;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.app-container.section-active .right-panel { width: 25%; }

.menu-columns-container { display: flex; width: 100%; height: 100%; }

.menu-column {
  flex: 1;
  height: 100%;
  background-color: var(--bg-white);
  border-right: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.4s ease;
}

.menu-column:last-child { border-right: none; }

.column-content { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.column-content i { font-size: 2.8rem; color: var(--green-primary); transition: transform 0.3s ease; }
.column-content span {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--green-primary);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

.menu-column:hover { background-color: var(--green-primary); }
.menu-column:hover .column-content i { color: var(--yellow-lightning); transform: scale(1.15); }
.menu-column:hover .column-content span { color: #ffffff; }

/* NAVEGACIÓN EN SECCIÓN */
.horizontal-nav-container {
  display: flex;
  width: 100%;
  height: 100%;
  background-color: var(--bg-white);
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0.5rem;
}

.side-nav-btn {
  background: transparent;
  border: none;
  color: var(--green-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  padding: 0.5rem;
  opacity: 0.75;
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

.side-nav-btn i { font-size: 1.2rem; }

.sub-nav-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--green-primary);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

.side-nav-btn:hover {
  opacity: 1;
  transform: scale(1.1);
  color: var(--green-dark);
}

.focused-center-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  height: 100%;
}

.focused-column-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--green-primary);
  text-align: center;
}

.focused-column-content i {
  font-size: 3rem;
  color: var(--green-primary);
  margin-bottom: 1rem;
}

.focused-column-content span {
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

/* BOTÓN INICIO ESTILO BLANCO */
.btn-home-return {
  background: var(--green-light);
  border: 1px solid var(--green-primary);
  color: var(--green-primary);
  padding: 0.6rem 1rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.btn-home-return i { color: var(--green-primary); }

.btn-home-return:hover {
  background: var(--green-primary);
  color: #ffffff;
}

.btn-home-return:hover i { color: var(--yellow-lightning); }

/* BOT DE WHATSAPP */
.whatsapp-bot-wrapper {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9000;
}

.whatsapp-trigger-btn {
  width: 55px;
  height: 55px;
  background-color: #25d366;
  color: white;
  border-radius: 50%;
  border: none;
  font-size: 1.8rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.whatsapp-chat-box {
  display: none;
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 300px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  overflow: hidden;
}

.whatsapp-chat-box.active { display: block; }
.chat-header { background: #075e54; color: white; padding: 1rem; display: flex; align-items: center; gap: 10px; }
.close-chat { background: none; border: none; color: white; font-size: 1.4rem; margin-left: auto; cursor: pointer; }
.chat-body { padding: 1rem; background: #e5ddd5; }
.bot-msg { background: white; padding: 0.8rem; border-radius: 10px; font-size: 0.85rem; margin-bottom: 1rem; }
.quick-options { display: flex; flex-direction: column; gap: 0.5rem; }
.quick-options button { background: white; border: 1px solid #25d366; color: #075e54; padding: 0.6rem; border-radius: 8px; font-size: 0.8rem; font-weight: 700; text-align: left; cursor: pointer; }

/* GALERÍA DE CLIENTES CENTRADA Y LIMPIA */
.clients-gallery-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin: auto 0;
  width: 100%;
}

.main-featured-image {
  width: 100%;
  max-width: 580px;
  height: 320px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.main-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.zoom-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 46, 32, 0.65);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.zoom-overlay i { font-size: 1.8rem; color: var(--yellow-lightning); }
.zoom-overlay span { font-size: 0.85rem; font-weight: 700; letter-spacing: 1px; }

.main-featured-image:hover .zoom-overlay { opacity: 1; }
.main-featured-image:hover img { transform: scale(1.03); }

/* CARRUSEL Y MINIATURAS */
.thumbnails-carousel-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 0.5rem;
  width: 100%;
  max-width: 600px;
}

.thumbnails-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 0.5rem 0.2rem;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
}

.thumbnail-card {
  flex: 0 0 calc(30% - 0.5rem);
  height: 70px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
}

.thumbnail-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85);
  transition: all 0.3s ease;
  border-radius: 6px;
}

.thumbnail-card:hover img {
  filter: brightness(1.1);
  transform: scale(1.05);
}

.thumbnail-card.active {
  border-color: var(--yellow-lightning);
  box-shadow: 0 0 12px var(--yellow-lightning);
  border-radius: 8px;
}

.thumbnail-card.active img {
  filter: brightness(1);
}

.carousel-arrow {
  background: rgba(255, 255, 255, 0.85);
  border: none;
  color: var(--green-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 5;
  transition: all 0.2s ease;
}

.carousel-arrow:hover {
  background: var(--yellow-lightning);
  color: var(--green-dark);
}

/* MODAL DE IMAGEN */
.image-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  padding: 2rem;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #ffffff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover { color: var(--yellow-lightning); }

/* ANIMACIONES */
@keyframes pulse { 0% { transform: scale(1); } 100% { transform: scale(1.15); } }
@keyframes flicker { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* RESPONSIVO */
@media (max-width: 900px) {
  body { overflow-y: auto; }
  .app-container, .app-container.section-active { flex-direction: column; height: auto; }
  .left-panel, .app-container.section-active .left-panel,
  .right-panel, .app-container.section-active .right-panel { width: 100%; height: auto; }
  .right-panel { height: 350px; border-left: none; border-top: 1px solid var(--border-color); }
  .sub-nav-title, .focused-column-content span { writing-mode: horizontal-tb; transform: none; }
  .clients-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-container { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .service-card.full-span { grid-column: span 1; }

  /* AJUSTE RESPONSIVO CLIENTES */
  .main-featured-image { height: 220px; }
  .thumbnail-card { flex: 0 0 calc(40% - 0.5rem); height: 60px; }
}