/* ═══════════════════════════════════════════
   MG Electricidad — Demo Web v1
   Variables centralizadas (editar aquí)
   ═══════════════════════════════════════════ */
:root {
  --primary: #0F172A;
  --secondary: #1D4ED8;
  --accent: #FACC15;
  --accent-hover: #EAB308;
  --bg: #F8FAFC;
  --text: #111827;
  --text-muted: #64748B;
  --white: #FFFFFF;
  --border: #E2E8F0;
  --whatsapp: #25D366;
  --whatsapp-dark: #128C7E;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 20px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.15);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 72px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.nav-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button,
input,
textarea {
  font: inherit;
  border: none;
  outline: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Icon utility ── */
.icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn--lg {
  padding: 1rem 1.75rem;
  font-size: 1rem;
}

.btn--full {
  width: 100%;
}

.btn--primary {
  background: var(--secondary);
  color: var(--white);
}

.btn--primary:hover {
  background: #1e40af;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--whatsapp {
  background: var(--whatsapp);
  color: var(--white);
}

.btn--whatsapp:hover {
  background: var(--whatsapp-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
}

.btn--outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.btn--outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.btn--accent {
  background: var(--accent);
  color: var(--primary);
}

.btn--accent:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(250, 204, 21, 0.4);
}

/* ── Logo ── */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.logo__mg {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.5rem;
}

.logo__text {
  color: var(--primary);
}

.logo--footer .logo__text {
  color: var(--white);
}

/* ── Header ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  transition: var(--transition);
}

/* Sobre el hero oscuro: texto claro */
.header:not(.header--scrolled) .logo__text {
  color: var(--white);
}

.header:not(.header--scrolled) .nav__list a {
  color: rgba(255, 255, 255, 0.8);
}

.header:not(.header--scrolled) .nav__list a:hover {
  color: var(--accent);
}

.header:not(.header--scrolled) .nav-toggle span {
  background: var(--white);
}

.header--scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav__list a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}

.nav__list a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary);
  transition: width var(--transition);
}

.nav__list a:hover {
  color: var(--primary);
}

.nav__list a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
  border-radius: 2px;
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 3rem) 0 4rem;
  background: var(--primary);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(29, 78, 216, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 78, 216, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}

.hero__glow--1 {
  width: 500px;
  height: 500px;
  background: var(--secondary);
  top: -10%;
  right: -5%;
}

.hero__glow--2 {
  width: 400px;
  height: 400px;
  background: var(--accent);
  bottom: 10%;
  left: -10%;
  opacity: 0.15;
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero__badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(29, 78, 216, 0.2);
  border: 1px solid rgba(29, 78, 216, 0.4);
  border-radius: 100px;
  color: #93C5FD;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero__title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--white);
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero__subtitle {
  font-size: 1.125rem;
  color: #94A3B8;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 540px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.hero__stats {
  display: flex;
  gap: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero__stats li {
  display: flex;
  flex-direction: column;
}

.hero__stats strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.hero__stats span {
  font-size: 0.8125rem;
  color: #94A3B8;
  margin-top: 0.25rem;
}

.hero__visual {
  position: relative;
}

.hero__image-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero__image-wrap img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.hero__image-accent {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
}

.hero__card-float {
  position: absolute;
  bottom: -1.5rem;
  left: -1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: float 4s ease-in-out infinite;
}

.hero__card-float svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
  flex-shrink: 0;
}

.hero__card-float strong {
  display: block;
  font-size: 0.875rem;
  color: var(--primary);
}

.hero__card-float span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ── Trust cards ── */
.trust {
  margin-top: -3rem;
  position: relative;
  z-index: 10;
  padding-bottom: 1rem;
}

.trust__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* ── Sections ── */
.section {
  padding: 5rem 0;
}

.section--alt {
  background: var(--white);
}

.section--dark {
  background: var(--primary);
}

.section--contact {
  background: linear-gradient(180deg, var(--bg) 0%, #EEF2FF 100%);
}

.section__header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
}

.section__label {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--secondary);
  margin-bottom: 0.75rem;
}

.section__label--light {
  color: var(--accent);
}

.section__title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section__title--light {
  color: var(--white);
}

.section__desc {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.section__cta {
  text-align: center;
  margin-top: 2.5rem;
}

/* ── Icon cards (trust & benefits) ── */
.icon-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.trust .icon-card {
  box-shadow: var(--shadow-md);
}

.icon-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(29, 78, 216, 0.2);
}

.icon-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.1), rgba(250, 204, 21, 0.15));
  border-radius: 10px;
  color: var(--secondary);
  margin-bottom: 1rem;
}

.icon-card__icon .icon {
  width: 22px;
  height: 22px;
}

.icon-card__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.icon-card__text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Services ── */
.services__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.service-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
  background: var(--white);
}

.service-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border-radius: 10px;
  color: var(--accent);
  margin-bottom: 1rem;
}

.service-card__icon .icon {
  width: 20px;
  height: 20px;
}

.service-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.service-card__text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}

.service-card__link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--secondary);
  transition: color var(--transition);
}

.service-card__link:hover {
  color: var(--primary);
}

/* ── Benefits ── */
.benefits__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ── About ── */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about__text {
  font-size: 1.0625rem;
  color: #94A3B8;
  line-height: 1.8;
  margin: 1.5rem 0 2rem;
}

.about__visual img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  aspect-ratio: 7/5;
  object-fit: cover;
}

/* ── Gallery ── */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-item__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem 1rem 1rem;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.85));
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 600;
}

/* ── FAQ ── */
.faq__list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item--open {
  border-color: var(--secondary);
  box-shadow: var(--shadow-sm);
}

.faq-item__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: none;
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

.faq-item__chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.faq-item--open .faq-item__chevron {
  transform: rotate(180deg);
  color: var(--secondary);
}

.faq-item__panel {
  padding: 0 1.5rem 1.25rem;
}

.faq-item__panel p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Contact ── */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact__subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin: 0.75rem 0 2rem;
}

.contact__details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.contact__details li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.contact__details svg {
  color: var(--secondary);
  flex-shrink: 0;
  margin-top: 2px;
}

.contact__details strong {
  display: block;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.contact__details a {
  color: var(--secondary);
  font-weight: 600;
  transition: color var(--transition);
}

.contact__details a:hover {
  color: var(--primary);
}

.contact__trust {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: rgba(29, 78, 216, 0.06);
  border-radius: var(--radius);
  border-left: 3px solid var(--secondary);
}

.contact__form {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.contact__form-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
  background: var(--white);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-feedback {
  margin-top: 1rem;
  font-size: 0.875rem;
  min-height: 1.25rem;
}

.form-feedback--success {
  color: #059669;
}

.form-feedback--error {
  color: #DC2626;
}

/* ── Footer ── */
.footer {
  background: var(--primary);
  color: #94A3B8;
  padding-top: 3.5rem;
}

.footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}

.footer__brand p {
  font-size: 0.9rem;
  margin-top: 1rem;
  line-height: 1.7;
  max-width: 320px;
}

.footer h4 {
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.footer__links ul,
.footer__contact ul {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer__links a,
.footer__contact a {
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer__links a:hover,
.footer__contact a:hover {
  color: var(--accent);
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 0;
}

.footer__bottom .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}

.footer__demo {
  color: var(--accent);
  font-weight: 600;
}

/* ── WhatsApp float ── */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--whatsapp);
  color: var(--white);
  border-radius: 100px;
  box-shadow: 0 4px 24px rgba(37, 211, 102, 0.45);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  animation: pulse-wa 3s ease-in-out infinite;
}

.whatsapp-float:hover {
  background: var(--whatsapp-dark);
  transform: scale(1.04);
  animation: none;
}

@keyframes pulse-wa {
  0%, 100% { box-shadow: 0 4px 24px rgba(37, 211, 102, 0.45); }
  50% { box-shadow: 0 4px 32px rgba(37, 211, 102, 0.65); }
}

/* ── Reveal animations ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay {
  transition-delay: 0.15s;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 1024px) {
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .benefits__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero__visual {
    max-width: 560px;
    margin: 0 auto;
  }

  .about {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .about__visual {
    order: -1;
  }

  .contact {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    height: 100dvh;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: calc(var(--header-h) + 2rem) 2rem 2rem;
    box-shadow: var(--shadow-lg);
    transition: right var(--transition);
    gap: 2rem;
  }

  .nav--open {
    right: 0;
  }

  .nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    width: 100%;
  }

  .nav__list a {
    font-size: 1.0625rem;
    color: var(--primary);
  }

  .nav__cta {
    width: 100%;
    justify-content: center;
  }

  .hero {
    padding-top: calc(var(--header-h) + 2rem);
    min-height: auto;
  }

  .hero__title {
    font-size: 1.875rem;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }

  .hero__stats {
    flex-wrap: wrap;
    gap: 1.25rem;
  }

  .hero__card-float {
    left: 0.5rem;
    bottom: -1rem;
    padding: 0.75rem 1rem;
  }

  .trust {
    margin-top: -2rem;
  }

  .trust__grid {
    grid-template-columns: 1fr;
  }

  .services__grid {
    grid-template-columns: 1fr;
  }

  .benefits__grid {
    grid-template-columns: 1fr;
  }

  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: 3.5rem 0;
  }

  .footer__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer__bottom .container {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .whatsapp-float__text {
    display: none;
  }

  .whatsapp-float {
    padding: 1rem;
    border-radius: 50%;
    bottom: 1.25rem;
    right: 1.25rem;
  }
}

@media (max-width: 480px) {
  .gallery__grid {
    grid-template-columns: 1fr;
  }

  .contact__form {
    padding: 1.5rem;
  }
}
