/* =========================================================
   ISH Solar Solutions — Estilos personalizados
   Complementa a Tailwind (vía CDN) con componentes de marca.
   Paleta:  verde #2ECC71 · azul #673DE6 · oscuro #1D1E20 · claro #FAFBFB
   ========================================================= */

:root {
  --ish-green: #2ECC71;
  --ish-blue:  #673DE6;
  --ish-dark:  #1D1E20;
  --ish-light: #FAFBFB;
}

/* Scroll suave al navegar por anclas y compensación por navbar fijo */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

/* ===== Navbar ===== */
/* Estado inicial (transparente sobre el hero) */
#navbar {
  background: transparent;
}
/* Estado al hacer scroll (se activa con JS añadiendo .scrolled) */
#navbar.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  box-shadow: 0 1px 20px rgba(29, 30, 32, 0.06);
}

/* Sobre el hero (navbar transparente): texto e iconos en blanco */
#navbar:not(.scrolled) .nav-link,
#navbar:not(.scrolled) .logo-text,
#navbar:not(.scrolled) #menu-toggle {
  color: #fff;
}
#navbar:not(.scrolled) #menu-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav-link {
  position: relative;
  transition: color 0.2s ease;
}
.nav-link:hover { color: var(--ish-green); }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--ish-green);
  transition: width 0.25s ease;
}
.nav-link:hover::after { width: 100%; }

.mobile-link {
  display: block;
  padding: 0.75rem 0.75rem;
  border-radius: 0.6rem;
  color: var(--ish-dark);
  transition: background 0.2s ease, color 0.2s ease;
}
.mobile-link:hover {
  background: rgba(46, 204, 113, 0.08);
  color: var(--ish-green);
}

/* ===== Botones ===== */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary {
  background: var(--ish-green);
  color: #fff;
  box-shadow: 0 8px 20px rgba(46, 204, 113, 0.3);
}
.btn-primary:hover {
  background: var(--ish-blue);
  box-shadow: 0 10px 24px rgba(103, 61, 230, 0.35);
  transform: translateY(-2px);
}
.btn-secondary {
  background: transparent;
  color: var(--ish-dark);
  border: 1.5px solid rgba(29, 30, 32, 0.15);
}
.btn-secondary:hover {
  border-color: var(--ish-green);
  color: var(--ish-green);
  transform: translateY(-2px);
}

/* ===== Hero con imagen de fondo ===== */
/* Capa de la fotografía (casa con paneles solares) */
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('hero-bg.png');
  background-size: cover;
  background-position: center;
  z-index: 0;
}
/* Overlay: degradado oscuro para legibilidad del texto blanco */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(15, 23, 20, 0.88) 0%,
    rgba(15, 23, 20, 0.65) 45%,
    rgba(15, 23, 20, 0.25) 100%
  );
  z-index: 1;
}
/* El contenido del hero va por encima de las dos capas */
.hero > .max-w-7xl { z-index: 2; }

/* Botón de vidrio (secundario sobre la foto) */
.btn-glass {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.btn-glass:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--ish-green);
  transform: translateY(-2px);
}

.text-gradient {
  background: linear-gradient(90deg, var(--ish-green), var(--ish-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline;
}

.metric-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(29, 30, 32, 0.05);
  border: 1px solid rgba(29, 30, 32, 0.04);
}
/* Variante glass para las métricas sobre la foto del hero */
.metric-card--glass {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ===== Badges de sección ===== */
.section-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: rgba(103, 61, 230, 0.1);
  color: var(--ish-blue);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ===== Tarjetas de Servicios ===== */
.service-card {
  padding: 2rem;
  background: var(--ish-light);
  border: 1px solid rgba(29, 30, 32, 0.06);
  border-radius: 1.25rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(29, 30, 32, 0.1);
  border-color: rgba(46, 204, 113, 0.4);
}
.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  margin-bottom: 1.25rem;
  transition: transform 0.25s ease;
}
.service-card:hover .service-icon { transform: scale(1.08) rotate(-4deg); }

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--ish-green);
  transition: gap 0.2s ease, color 0.2s ease;
}
.service-link:hover { gap: 0.7rem; color: var(--ish-blue); }

/* ===== Calculadora: sliders personalizados ===== */
.ish-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(46, 204, 113, 0.2);
  outline: none;
}
.ish-slider--blue { background: rgba(103, 61, 230, 0.2); }

/* Pulgar del slider (WebKit) */
.ish-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ish-green);
  border: 4px solid #fff;
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.5);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.ish-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.ish-slider--blue::-webkit-slider-thumb {
  background: var(--ish-blue);
  box-shadow: 0 2px 8px rgba(103, 61, 230, 0.5);
}
/* Pulgar del slider (Firefox) */
.ish-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ish-green);
  border: 4px solid #fff;
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.5);
  cursor: pointer;
}
.ish-slider--blue::-moz-range-thumb { background: var(--ish-blue); }

.calc-stat {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.9rem;
  padding: 1rem;
}
.calc-glow {
  position: absolute;
  bottom: -30%;
  right: -20%;
  width: 24rem;
  height: 24rem;
  background: radial-gradient(circle, rgba(46, 204, 113, 0.25), transparent 60%);
  filter: blur(10px);
  pointer-events: none;
}

/* ===== Testimonios ===== */
.testimonial-card {
  padding: 2rem;
  background: var(--ish-light);
  border: 1px solid rgba(29, 30, 32, 0.06);
  border-radius: 1.25rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(29, 30, 32, 0.08);
}
.stars {
  color: #F5B301;
  font-size: 1.15rem;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
}

/* ===== Formulario de contacto ===== */
.form-group { margin-bottom: 1.15rem; }
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ish-dark);
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(29, 30, 32, 0.12);
  border-radius: 0.75rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--ish-dark);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--ish-green);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.15);
}
/* Estado de error */
.form-group.has-error input,
.form-group.has-error select {
  border-color: #E5484D;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.12);
}
.error-msg {
  display: none;
  font-size: 0.8rem;
  color: #E5484D;
  margin-top: 0.35rem;
}
.form-group.has-error .error-msg { display: block; }

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  background: rgba(46, 204, 113, 0.12);
  color: var(--ish-green);
  flex-shrink: 0;
}

/* ===== Footer ===== */
.footer-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
}
.footer-link {
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.footer-link:hover {
  color: var(--ish-green);
  padding-left: 4px;
}
.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: background 0.2s ease, transform 0.2s ease;
}
.social-icon:hover {
  background: var(--ish-green);
  transform: translateY(-2px);
}
.newsletter-input {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 0.75rem;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s ease;
}
.newsletter-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.newsletter-input:focus {
  outline: none;
  border-color: var(--ish-green);
}

/* ===== Botón volver arriba (visible con .show vía JS) ===== */
#back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================
   Páginas legales (aviso de privacidad, términos, cookies, garantías)
   ========================================================= */
.legal-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(29, 30, 32, 0.06);
}
.legal-wrap {
  max-width: 56rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}
.legal-wrap h1 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  line-height: 1.15;
  color: var(--ish-dark);
  margin-bottom: 0.5rem;
}
.legal-meta {
  color: rgba(29, 30, 32, 0.55);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}
.legal-wrap h2 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ish-dark);
  margin: 2.25rem 0 0.75rem;
  padding-top: 0.5rem;
}
.legal-wrap h3 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ish-dark);
  margin: 1.5rem 0 0.5rem;
}
.legal-wrap p,
.legal-wrap li {
  color: rgba(29, 30, 32, 0.8);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}
.legal-wrap ul,
.legal-wrap ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}
.legal-wrap ul { list-style: disc; }
.legal-wrap ol { list-style: decimal; }
.legal-wrap a { color: var(--ish-blue); text-decoration: underline; }
.legal-wrap strong { color: var(--ish-dark); }
.legal-wrap table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.92rem;
}
.legal-wrap th,
.legal-wrap td {
  border: 1px solid rgba(29, 30, 32, 0.12);
  padding: 0.65rem 0.8rem;
  text-align: left;
  vertical-align: top;
}
.legal-wrap th {
  background: rgba(46, 204, 113, 0.08);
  font-weight: 600;
  color: var(--ish-dark);
}
/* Recuadro de aviso / placeholder para datos de la empresa */
.legal-note {
  background: rgba(103, 61, 230, 0.06);
  border: 1px solid rgba(103, 61, 230, 0.2);
  border-radius: 0.9rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.legal-note strong { color: var(--ish-blue); }
/* Índice de navegación entre documentos legales */
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}
.legal-nav a {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--ish-light);
  border: 1px solid rgba(29, 30, 32, 0.1);
  color: var(--ish-dark);
  text-decoration: none;
  transition: all 0.2s ease;
}
.legal-nav a:hover { border-color: var(--ish-green); color: var(--ish-green); }
.legal-nav a.active { background: var(--ish-green); color: #fff; border-color: var(--ish-green); }

/* =========================================================
   Banner de consentimiento de cookies (opt-in)
   ========================================================= */
.ish-cc-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  max-width: 60rem;
  margin: 0 auto;
  background: #fff;
  border: 1px solid rgba(29, 30, 32, 0.08);
  border-radius: 1.1rem;
  box-shadow: 0 18px 50px rgba(29, 30, 32, 0.18);
  transform: translateY(140%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.ish-cc-banner.is-visible { transform: translateY(0); opacity: 1; }
.ish-cc-banner-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}
@media (min-width: 900px) {
  .ish-cc-banner-inner { flex-direction: row; align-items: center; }
}
.ish-cc-text strong {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  color: var(--ish-dark);
  display: block;
  margin-bottom: 0.25rem;
}
.ish-cc-text p { font-size: 0.9rem; color: rgba(29, 30, 32, 0.7); line-height: 1.55; }
.ish-cc-text a { color: var(--ish-blue); text-decoration: underline; }
.ish-cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  flex-shrink: 0;
}
.ish-cc-btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.1rem;
  border-radius: 0.65rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.ish-cc-btn--primary { background: var(--ish-green); color: #fff; }
.ish-cc-btn--primary:hover { background: var(--ish-blue); }
.ish-cc-btn--ghost {
  background: transparent;
  color: var(--ish-dark);
  border-color: rgba(29, 30, 32, 0.18);
}
.ish-cc-btn--ghost:hover { border-color: var(--ish-green); color: var(--ish-green); }

/* Modal de preferencias */
.ish-cc-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(29, 30, 32, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ish-cc-modal.is-visible { display: flex; }
.ish-cc-modal-card {
  background: #fff;
  border-radius: 1.25rem;
  width: 100%;
  max-width: 34rem;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}
.ish-cc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(29, 30, 32, 0.08);
}
.ish-cc-modal-head h3 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ish-dark);
}
.ish-cc-close {
  font-size: 1.6rem;
  line-height: 1;
  color: rgba(29, 30, 32, 0.5);
  cursor: pointer;
  background: none;
  border: none;
}
.ish-cc-close:hover { color: var(--ish-dark); }
.ish-cc-modal-body { padding: 0.5rem 1.5rem; }
.ish-cc-modal-foot {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(29, 30, 32, 0.08);
}
.ish-cc-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(29, 30, 32, 0.06);
}
.ish-cc-row:last-child { border-bottom: none; }
.ish-cc-row-title {
  display: block;
  font-weight: 600;
  color: var(--ish-dark);
  margin-bottom: 0.15rem;
}
.ish-cc-row-desc { display: block; font-size: 0.85rem; color: rgba(29, 30, 32, 0.6); line-height: 1.5; }

/* Interruptor (switch) */
.ish-cc-switch { position: relative; flex-shrink: 0; width: 46px; height: 26px; }
.ish-cc-switch input { opacity: 0; width: 0; height: 0; }
.ish-cc-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(29, 30, 32, 0.2);
  transition: background 0.2s ease;
  cursor: pointer;
}
.ish-cc-slider::before {
  content: "";
  position: absolute;
  left: 3px; top: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.ish-cc-switch input:checked + .ish-cc-slider { background: var(--ish-green); }
.ish-cc-switch input:checked + .ish-cc-slider::before { transform: translateX(20px); }
.ish-cc-switch input:disabled + .ish-cc-slider { background: var(--ish-green); opacity: 0.55; cursor: not-allowed; }

/* ===== Animación de aparición al hacer scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
