/* ============================================================
   EcoInstala — Hoja de estilos principal
   Web de instalación de placas solares en Alicante.
   Mobile-first · sin dependencias externas · enfocado a
   rendimiento, accesibilidad y conversión.
   Paleta de marca: editar las variables en :root (final del archivo).
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--c-link); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus { color: var(--c-link-hover); }

:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; border-radius: 2px; }

ul, ol { margin: 0; padding: 0; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 1.1rem;
}

.section { padding: 3rem 0; }
.section--alt { background: var(--c-surface); }
.section--green { background: var(--c-primary); color: #fff; }

@media (min-width: 768px) {
  .section { padding: 4.25rem 0; }
}

.section-head { max-width: 62ch; margin-bottom: 2rem; }
.section-head.center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin-bottom: .5rem;
}
.section--green .eyebrow, .section--dark .eyebrow { color: var(--c-accent); }

/* ---------- Tipografía ---------- */
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; color: var(--c-heading); font-weight: 800; }
.section--green h1, .section--green h2, .section--green h3 { color: #fff; }

h1 { font-size: clamp(1.9rem, 3.5vw + 1rem, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.55rem, 2vw + .8rem, 2.25rem); letter-spacing: -.01em; }
h3 { font-size: clamp(1.18rem, 1vw + .7rem, 1.4rem); }
p { margin: 0 0 1rem; }
.lead { font-size: 1.15rem; color: var(--c-text-soft); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .95rem 1.6rem;
  border-radius: 9px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 52px;
  transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--c-primary); color: #fff; box-shadow: 0 6px 18px rgba(21,128,61,.28); }
.btn--primary:hover, .btn--primary:focus { background: var(--c-primary-dark); color: #fff; }
.btn--accent { background: var(--c-accent); color: #3a2a06; box-shadow: 0 6px 18px rgba(245,158,11,.32); }
.btn--accent:hover, .btn--accent:focus { background: var(--c-accent-dark); color: #3a2a06; }
.btn--ghost { background: transparent; color: var(--c-primary); border-color: var(--c-border-strong); }
.btn--ghost:hover, .btn--ghost:focus { background: var(--c-surface); color: var(--c-primary-dark); }
.btn--lg { padding: 1.1rem 2rem; font-size: 1.08rem; min-height: 58px; }
.btn--block { width: 100%; }
.btn--ondark { background: #fff; color: var(--c-primary-dark); }
.btn--ondark:hover, .btn--ondark:focus { background: #f0f0f0; color: var(--c-primary-dark); }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.97);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--c-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 0;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: 1.32rem;
  color: var(--c-heading);
  text-decoration: none;
  letter-spacing: -.02em;
}
.logo .logo-mark { color: var(--c-accent); font-size: 1.5rem; line-height: 1; }
.logo b { color: var(--c-primary); }

.main-nav { display: none; }
.nav-list { display: flex; gap: 1.4rem; list-style: none; }
.nav-list a {
  text-decoration: none;
  font-weight: 600;
  font-size: .98rem;
  color: var(--c-heading);
  padding: .3rem 0;
}
.nav-list a:hover, .nav-list a[aria-current="page"] {
  color: var(--c-primary);
  box-shadow: inset 0 -2px 0 var(--c-primary);
}

.header-actions { display: flex; align-items: center; gap: .6rem; }
.header-phone {
  display: none;
  align-items: center;
  gap: .4rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--c-primary-dark);
  text-decoration: none;
  white-space: nowrap;
}
.header-phone:hover { color: var(--c-primary); }
.header-cta { display: none; }

/* Menú móvil (CSS puro, sin JavaScript) */
.nav-toggle { display: none; }
.nav-toggle-label {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  padding: 10px;
  cursor: pointer;
  border: 1px solid var(--c-border);
  border-radius: 8px;
}
.nav-toggle-label span {
  display: block;
  height: 3px;
  background: var(--c-heading);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle:checked ~ .main-nav { display: block; }
.nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) { opacity: 0; }
.nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 919px) {
  .main-nav {
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: #fff;
    border-bottom: 1px solid var(--c-border);
    box-shadow: 0 12px 24px rgba(0,0,0,.08);
    padding: .5rem 0 1rem;
  }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-list li { border-top: 1px solid var(--c-border); }
  .nav-list a { display: block; padding: .85rem 1.1rem; }
  .nav-list a:hover, .nav-list a[aria-current="page"] { box-shadow: none; background: var(--c-surface); }
}

@media (min-width: 920px) {
  .main-nav { display: block; }
  .nav-toggle-label { display: none; }
  .header-phone { display: inline-flex; }
  .header-cta { display: inline-flex; }
}

/* ---------- Submenús del menú de doble eje ---------- */
.has-submenu { position: relative; }
.submenu-toggle {
  font: inherit;
  font-weight: 600;
  font-size: .98rem;
  color: var(--c-heading);
  background: none;
  border: 0;
  cursor: pointer;
}
.submenu { list-style: none; margin: 0; padding: 0; }

@media (min-width: 920px) {
  .submenu-toggle {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem 0;
  }
  .submenu-toggle::after { content: "▾"; font-size: .75em; }
  .submenu-toggle:hover { color: var(--c-primary); }
  .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    min-width: 250px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(15,33,58,.13);
    padding: .4rem 0;
  }
  .has-submenu:hover .submenu,
  .has-submenu:focus-within .submenu,
  .has-submenu.is-open .submenu { display: block; }
  .submenu a {
    display: block;
    padding: .55rem 1.1rem;
    font-weight: 500;
    white-space: nowrap;
  }
  .submenu a:hover,
  .submenu a[aria-current="page"] {
    background: var(--c-surface);
    box-shadow: none;
    color: var(--c-primary);
  }
}

@media (max-width: 919px) {
  .submenu-toggle {
    display: block;
    width: 100%;
    text-align: left;
    padding: .85rem 1.1rem;
    color: var(--c-text-soft);
    text-transform: uppercase;
    font-size: .8rem;
    letter-spacing: .07em;
  }
  .submenu a { padding-left: 2.1rem; }
}

/* ---------- Migas de pan ---------- */
.breadcrumbs { background: var(--c-surface); border-bottom: 1px solid var(--c-border); }
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  list-style: none;
  padding: .7rem 0;
  font-size: .88rem;
}
.breadcrumbs li + li::before { content: "›"; margin-right: .4rem; color: var(--c-text-soft); }
.breadcrumbs a { color: var(--c-text-soft); }
.breadcrumbs [aria-current="page"] { color: var(--c-text); font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 380px at 88% -8%, rgba(245,158,11,.18), transparent 60%),
    linear-gradient(180deg, var(--c-surface) 0%, #fff 100%);
  padding: 2.6rem 0 3rem;
}
.hero-grid { display: grid; gap: 2rem; }
.hero h1 { margin-bottom: .5rem; }
.hero .lead { margin-bottom: 1.6rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.5rem; }

.hero-media {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--c-surface-2);
  height: 240px;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Imagen de contenido ---------- */
.content-media {
  border-radius: 16px;
  overflow: hidden;
  background: var(--c-surface-2);
  height: 240px;
}
.content-media img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 860px) {
  .content-media { height: 340px; }
}

@media (min-width: 880px) {
  .hero { padding: 4rem 0 4.5rem; }
  .hero-grid { grid-template-columns: 1.05fr .95fr; align-items: center; gap: 3rem; }
  .hero-media { height: 400px; }
}

/* ---------- Barra de confianza ---------- */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem 1.4rem;
  list-style: none;
  font-size: .95rem;
  font-weight: 600;
  color: var(--c-text-soft);
}
.trust-bar li { display: flex; align-items: center; gap: .4rem; }
.trust-bar .ico { color: var(--c-primary); font-weight: 800; }

/* Valoración Google */
.google-rating {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: .35rem .85rem;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--c-text);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.stars { color: #f5a623; letter-spacing: 1px; }
.google-rating .g { font-weight: 800; color: #4285f4; }

/* ---------- Rejilla de tarjetas ---------- */
.cards {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
}
.card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 13px;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15,33,58,.1); border-color: var(--c-primary-soft); }
.card-icon {
  width: 50px; height: 50px;
  display: grid; place-items: center;
  font-size: 1.5rem;
  background: var(--c-primary-soft);
  border-radius: 11px;
  margin-bottom: .9rem;
}
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--c-text-soft); font-size: .98rem; flex-grow: 1; }
.card-link { font-weight: 700; text-decoration: none; color: var(--c-primary); margin-top: .6rem; }
.card-link::after { content: " →"; }

/* ---------- Bloque "por qué" / features ---------- */
.split { display: grid; gap: 2rem; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; align-items: center; gap: 3rem; } }

.feature-list { list-style: none; display: grid; gap: 1rem; }
.feature-list li { display: flex; gap: .8rem; }
.feature-list .ico {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
  border-radius: 8px;
  font-weight: 800;
}
.feature-list strong { display: block; color: var(--c-heading); }
.feature-list span { color: var(--c-text-soft); font-size: .96rem; }

/* ---------- Estadísticas ---------- */
.stats {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat {
  text-align: center;
  padding: 1.3rem 1rem;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
}
.stat-num { font-size: 2rem; font-weight: 800; color: var(--c-primary); line-height: 1.1; }
.stat-label { font-size: .9rem; color: var(--c-text-soft); }

/* ---------- Ahorro ---------- */
.savings-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 1.4rem;
}
.savings-figure {
  padding: 1.4rem 1rem;
  background: #fff;
  border: 1px solid var(--c-border);
  border-top: 4px solid var(--c-accent);
  border-radius: 12px;
  text-align: center;
}
.savings-figure b { display: block; font-size: 2.05rem; color: var(--c-heading); line-height: 1.1; }
.savings-figure span { font-size: .92rem; color: var(--c-text-soft); }

.note {
  font-size: .92rem;
  color: var(--c-text-soft);
  background: var(--c-surface);
  border-left: 3px solid var(--c-primary-soft);
  padding: .8rem 1rem;
  border-radius: 0 8px 8px 0;
}

/* ---------- Tablas de datos ---------- */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  overflow: hidden;
}
.data-table caption { text-align: left; font-size: .88rem; color: var(--c-text-soft); margin-bottom: .5rem; }
.data-table th, .data-table td { padding: .8rem .95rem; text-align: left; border-bottom: 1px solid var(--c-border); }
.data-table thead th { background: var(--c-heading); color: #fff; font-weight: 700; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) td { background: #fafbfc; }
.data-table .row-total td { font-weight: 800; color: var(--c-primary-dark); background: var(--c-primary-soft); }
.data-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Pasos del proceso ---------- */
.steps { display: grid; gap: 1rem; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(5, 1fr); } }
.step {
  position: relative;
  padding: 1.3rem 1.1rem;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
}
.step-num {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--c-primary);
  color: #fff;
  font-weight: 800;
  border-radius: 50%;
  margin-bottom: .7rem;
}
.step h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.step p { font-size: .92rem; color: var(--c-text-soft); margin: 0; }

/* ---------- Banda CTA ---------- */
.cta-band { background: var(--c-heading); color: #fff; }
.cta-band .inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  padding: 2.4rem 0;
}
.cta-band h2 { margin: 0 0 .25rem; }
.cta-band p { margin: 0; color: #c4d0de; }
.cta-band .cta-actions { display: flex; flex-wrap: wrap; gap: .7rem; }

/* ---------- Proyectos ---------- */
.project-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 13px;
  overflow: hidden;
}
.project-body { padding: 1.2rem 1.3rem 1.4rem; }

/* ---------- Testimonios ---------- */
.testimonial {
  background: #fff;
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-primary);
  border-radius: 4px 11px 11px 4px;
  padding: 1.4rem 1.5rem;
}
.testimonial p { font-style: italic; }
.testimonial-author { font-weight: 700; font-size: .92rem; color: var(--c-text-soft); font-style: normal; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: .6rem; max-width: 800px; }
.faq-item {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 0 1.1rem;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.04rem;
  padding: 1rem 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  color: var(--c-heading);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.6rem; color: var(--c-primary); line-height: .8; flex: none; }
.faq-item[open] summary::after { content: "−"; }
.faq-item .answer { padding-bottom: 1.1rem; color: var(--c-text-soft); }
.faq-item .answer p:last-child { margin-bottom: 0; }

/* ---------- Cobertura ---------- */
.coverage-list {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  list-style: none;
}
.coverage-list a {
  display: inline-block;
  padding: .55rem 1rem;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  color: var(--c-heading);
}
.coverage-list a:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* ---------- Formulario ---------- */
.form { display: grid; gap: 1rem; }
.form-row { display: grid; gap: 1rem; }
@media (min-width: 560px) { .form-row.two { grid-template-columns: 1fr 1fr; } }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label { font-weight: 600; font-size: .94rem; color: var(--c-heading); }
.form-group input,
.form-group select,
.form-group textarea {
  font: inherit;
  padding: .8rem .9rem;
  border: 1px solid var(--c-border-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--c-text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(21,128,61,.15); }
.form-group textarea { resize: vertical; min-height: 96px; }
.form-consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; color: var(--c-text-soft); }
.form-consent input { margin-top: .2rem; }
.form-note { font-size: .85rem; color: var(--c-text-soft); }

.form-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 1.6rem;
  box-shadow: 0 14px 36px rgba(15,33,58,.08);
}

/* ---------- Pie ---------- */
.site-footer { background: var(--c-heading); color: #b9c5d3; padding: 3rem 0 1.4rem; }
.footer-grid {
  display: grid;
  gap: 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.site-footer h3 { color: #fff; font-size: 1.05rem; margin-bottom: .9rem; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: .45rem; }
.site-footer a { color: #b9c5d3; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer address { font-style: normal; line-height: 1.8; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.2rem;
  justify-content: space-between;
  font-size: .86rem;
  color: #8a99ab;
}

/* ---------- CTA fija en móvil ---------- */
.mobile-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 95;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -3px 14px rgba(0,0,0,.1);
}
.mobile-cta a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .95rem .5rem;
  font-weight: 700;
  font-size: .96rem;
  text-decoration: none;
  min-height: 56px;
}
.mobile-cta .m-call { background: var(--c-primary); color: #fff; }
.mobile-cta .m-quote { background: var(--c-accent); color: #3a2a06; }
@media (min-width: 920px) { .mobile-cta { display: none; } }
@media (max-width: 919px) { body { padding-bottom: 56px; } }

/* ---------- Marcador de dato pendiente ---------- */
.pendiente {
  background: #fef3c7;
  color: #92400e;
  padding: .05em .35em;
  border-radius: 3px;
  font-size: .96em;
  font-weight: 600;
}

/* ---------- Utilidades ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }
.skip-link {
  position: absolute;
  left: -999px;
}
.skip-link:focus {
  left: 1rem; top: 1rem;
  z-index: 200;
  background: #fff;
  padding: .7rem 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* ============================================================
   Variables de marca — personalizar aquí
   ============================================================ */
:root {
  --c-primary: #15803d;        /* verde solar */
  --c-primary-dark: #166534;
  --c-primary-soft: #dcfce7;
  --c-accent: #f59e0b;         /* ámbar (sol) */
  --c-accent-dark: #d97706;

  --c-text: #1f2937;
  --c-text-soft: #51606f;
  --c-heading: #0f213a;        /* navy oscuro */

  --c-link: #15803d;
  --c-link-hover: #166534;

  --c-bg: #ffffff;
  --c-surface: #f3f8f4;        /* verde muy claro */
  --c-surface-2: #eef2f5;
  --c-border: #e3e8ee;
  --c-border-strong: #cdd5de;
}
