/* ============================================================
   Toledo Electricidad e Instalaciones — Hoja de estilos
   Mobile-first. Breakpoint principal: 768px
   ============================================================ */

/* ---------- Variables ---------- */
:root {
  --color-navy:      #0d1f3c;
  --color-navy-mid:  #1a3560;
  --color-orange:    #f07800;
  --color-orange-dk: #d46800;
  --color-green:     #25d366;   /* WhatsApp */
  --color-green-dk:  #1ebe5a;
  --color-white:     #ffffff;
  --color-light:     #f5f7fa;
  --color-grey:      #6b7280;
  --color-border:    #e2e8f0;

  --font-base: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius:    10px;
  --shadow:    0 4px 20px rgba(0,0,0,.10);
  --transition: .25s ease;
  --header-h: 68px;
}

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-base); color: #1e2a3b; background: var(--color-white); line-height: 1.65; }
img  { max-width: 100%; display: block; }
a    { text-decoration: none; color: inherit; }
ul   { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ---------- Contenedor ---------- */
.container {
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
  text-align: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

/* Tamaños */
.btn--sm  { padding: .45rem 1rem;  font-size: .85rem; }
.btn--lg  { padding: .9rem 1.6rem; font-size: 1rem;   min-height: 52px; }
.btn--full{ width: 100%; }

/* Variantes */
.btn--orange  { background: var(--color-orange);  color: var(--color-white); }
.btn--orange:hover  { background: var(--color-orange-dk); }

.btn--green   { background: var(--color-green);   color: var(--color-white); }
.btn--green:hover   { background: var(--color-green-dk); }

.btn--blue    { background: var(--color-navy-mid); color: var(--color-white); }
.btn--blue:hover    { background: var(--color-navy); }

.btn--white   { background: var(--color-white);   color: var(--color-navy); border-color: var(--color-white); }
.btn--white:hover   { background: var(--color-light); }

.btn--outline { background: transparent; color: var(--color-white); border-color: rgba(255,255,255,.7); }
.btn--outline:hover { background: rgba(255,255,255,.12); }

/* ============================================================
   CABECERA FIJA
   ============================================================ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--color-navy);
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: transparent;
}
.logo__img {
  height: 58px;
  width: auto;
  display: block;
  background: transparent;
}

/* Logo pie de página */
.footer__logo-img {
  height: 48px;
  width: auto;
  display: block;
  background: transparent;
  margin-bottom: .4rem;
}

/* Nav desktop (oculto por defecto en móvil) */
.nav { display: none; }

.nav__list { display: flex; gap: .1rem; }
.nav__link {
  display: block;
  padding: .5rem .75rem;
  color: rgba(255,255,255,.85);
  font-size: .88rem;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
.nav__link:hover,
.nav__link.active { color: var(--color-white); background: rgba(255,255,255,.1); }

/* Acciones header */
.header__actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0;
}
.header__phone {
  display: none; /* visible en tablet/desktop */
  color: var(--color-orange);
  font-weight: 700;
  font-size: .95rem;
}

/* Hamburguesa */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: .4rem;
  width: 36px;
  height: 36px;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menú móvil */
.mobile-nav {
  overflow: hidden;
  max-height: 0;
  transition: max-height .35s ease;
  background: var(--color-navy-mid);
}
.mobile-nav.is-open { max-height: 600px; }

.mobile-nav__list { padding: .5rem 1.25rem 0; }
.mobile-nav__link {
  display: block;
  padding: .8rem 0;
  color: rgba(255,255,255,.9);
  font-size: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.mobile-nav__link:last-child { border-bottom: none; }

.mobile-nav__actions {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

/* ============================================================
   HÉROE
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  background:
    url('imagenes/fondo-toledo.png') top right / cover no-repeat;
  padding-top: var(--header-h);
  overflow: hidden;
}

/* Overlay: capa azul marino semitransparente sobre la foto */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 55, 0.38);
}

/* Layout interno: dos columnas en desktop, apilado en móvil */
.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  padding-block: 5rem 3.5rem;
  width: 100%;
}

/* Columna de texto */
.hero__content {
  text-align: center;
  flex: 1;
}

/* Columna del logo grande */
.hero__logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.hero__logo {
  width: min(300px, 82vw);
  height: auto;
  background: transparent;
  filter: drop-shadow(0 6px 32px rgba(0, 0, 0, 0.55));
}

.hero__badge {
  display: inline-block;
  background: rgba(255,255,255,.1);
  color: var(--color-orange);
  border: 1px solid rgba(240,120,0,.4);
  border-radius: 50px;
  padding: .35rem 1rem;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: 1.25rem;
}

.hero__title {
  font-size: clamp(1.1rem, 5.5vw, 3.5rem); /* escala con el viewport para caber en una línea */
  font-weight: 800;
  color: var(--color-white);
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

/* Cada línea del titular: bloque, sin salto interno */
.hero__title-line {
  display: block;
  white-space: nowrap;
}
.highlight { color: var(--color-orange); }

/* Segunda línea naranja del titular del hero */
.hero__title-accent {
  display: block;
  white-space: nowrap;   /* impide que se parta en dos líneas */
  color: var(--color-orange);
}

.hero__subtitle {
  font-size: clamp(.95rem, 2.5vw, 1.2rem);
  color: rgba(255,255,255,.75);
  max-width: 520px;
  margin-inline: auto;
  margin-bottom: 2rem;
  text-align: justify;
}

.hero__buttons {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

/* Puntos clave */
.hero__trust {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: center;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #ffffff;
  font-size: .85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  padding: .5rem 1.1rem;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.trust-item__icon { font-size: 1.1rem; }

/* ============================================================
   SECCIONES GENÉRICAS
   ============================================================ */
.section { padding-block: 4rem; }
.section--grey { background: var(--color-light); }

.section__header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section__title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  color: var(--color-navy);
  margin-bottom: .5rem;
}
.section__title::after {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  background: var(--color-orange);
  border-radius: 2px;
  margin: .6rem auto 0;
}
.section__subtitle {
  color: var(--color-grey);
  font-size: 1rem;
}

/* ============================================================
   SERVICIOS
   ============================================================ */
.services { background: var(--color-light); }

.services__grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

.service-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,.13);
}
.service-card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: .9rem;
  color: var(--color-navy-mid);
}
.service-card__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.service-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: .5rem;
}
.service-card__desc {
  font-size: .9rem;
  color: var(--color-grey);
  line-height: 1.6;
}

/* ============================================================
   SOBRE MÍ
   ============================================================ */
.about__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.about__photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(13,31,60,.18);
  object-fit: cover;
}

.about__text p {
  margin-bottom: 1rem;
  color: #374151;
}
.about__badges {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: 1.25rem;
}
.about__badges li {
  font-size: .92rem;
  font-weight: 600;
  color: var(--color-navy);
}
.about__badges li.about__badge--sub {
  padding-left: 1.5rem;
  font-size: .85rem;
  font-weight: 500;
  color: #c8860a;
}

/* ============================================================
   PROYECTOS
   ============================================================ */
.projects { background: var(--color-light); }

.projects__grid {
  display: grid;
  gap: 1.25rem;
}

.project-card {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.project-card__thumb {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}
.project-card__thumb--1 { background: linear-gradient(135deg, #1a3560 0%, #2e5fa3 100%); }
.project-card__thumb--2 { background: linear-gradient(135deg, #f07800 0%, #f5a623 100%); }
.project-card__thumb--3 { background: linear-gradient(135deg, #065f46 0%, #059669 100%); }

.project-card__body { padding: 1.25rem; }
.project-card__tag {
  display: inline-block;
  background: var(--color-light);
  color: var(--color-navy);
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .65rem;
  border-radius: 50px;
  margin-bottom: .5rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.project-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: .4rem;
}
.project-card p {
  font-size: .88rem;
  color: var(--color-grey);
}

/* ============================================================
   URGENCIAS
   ============================================================ */
.urgency {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-mid) 100%);
  padding-block: 3.5rem;
}
.urgency__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.75rem;
}
.urgency__text h2 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--color-white);
  margin-bottom: .5rem;
}
.urgency__text p {
  color: rgba(255,255,255,.78);
  font-size: .97rem;
}
.urgency__buttons {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  width: 100%;
  max-width: 320px;
}

/* ============================================================
   CONTACTO
   ============================================================ */

/* Bloque centrado sin formulario */
.contact__centered {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.contact__intro {
  color: var(--color-grey);
  font-size: .97rem;
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* Tarjetas de contacto: columna en móvil, fila en desktop */
.contact__items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 2px solid var(--color-border);
  background: var(--color-white);
  transition: border-color var(--transition), box-shadow var(--transition);
  text-align: left;
}
.contact-item:hover {
  border-color: var(--color-orange);
  box-shadow: 0 4px 16px rgba(240,120,0,.12);
}
.contact-item__icon { font-size: 1.6rem; flex-shrink: 0; }
.contact-item div   { display: flex; flex-direction: column; }
.contact-item strong { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--color-grey); }
.contact-item span   { font-size: 1rem; font-weight: 700; color: var(--color-navy); }

/* Botones grandes centrados */
.contact__big-buttons {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: center;
}

/* Bloque de horario en la sección de contacto */
.contact__hours {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  width: 100%;
  max-width: 480px;
  margin: 2rem auto 0;
}
.contact__hours-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  background: var(--color-light);
  border-left: 4px solid var(--color-navy-mid);
}
.contact__hours-item--urgency {
  border-left-color: #dc2626;
  background: rgba(220, 38, 38, .05);
}
.contact__hours-item--urgency strong {
  color: #dc2626;
}
.contact__hours-icon { font-size: 1.3rem; flex-shrink: 0; }
.contact__hours-item div { display: flex; flex-direction: column; gap: .1rem; }
.contact__hours-item strong {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-grey);
}
.contact__hours-item span {
  font-size: .95rem;
  font-weight: 700;
  color: var(--color-navy);
}

/* ============================================================
   PIE DE PÁGINA
   ============================================================ */
.footer {
  background: var(--color-navy);
  color: rgba(255,255,255,.75);
  padding-top: 2.5rem;
}
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 2rem;
}
.footer__brand { text-align: center; }
.footer__brand p { font-size: .85rem; color: rgba(255,255,255,.55); margin-top: .1rem; }

.footer__links nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1rem;
}
.footer__links a {
  color: rgba(255,255,255,.7);
  font-size: .88rem;
  transition: color var(--transition);
}
.footer__links a:hover { color: var(--color-orange); }

.footer__contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.footer__contact a,
.footer__contact span {
  font-size: .88rem;
  color: rgba(255,255,255,.7);
  transition: color var(--transition);
}
.footer__contact a:hover { color: var(--color-orange); }

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: .78rem;
  color: rgba(255,255,255,.4);
}

/* ============================================================
   BOTÓN FLOTANTE WHATSAPP
   ============================================================ */
.whatsapp-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 900;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--color-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  box-shadow: 0 4px 20px rgba(37,211,102,.5);
  transition: transform var(--transition), box-shadow var(--transition);
}
.whatsapp-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37,211,102,.6);
}

/* ============================================================
   RESPONSIVE — 480px
   ============================================================ */
@media (min-width: 480px) {
  .hero__buttons,
  .urgency__buttons {
    flex-direction: row;
    justify-content: center;
  }
  .hero__trust {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   RESPONSIVE — 768px (tablet/desktop)
   ============================================================ */
@media (min-width: 768px) {
  /* Tamaño de logos en desktop */
  .logo__img        { height: 68px; }
  .footer__logo-img { height: 58px; }

  /* Alinea el logo de cabecera con el texto del hero */
  .logo { transform: translateX(-3cm); }

  /* Hero: dos columnas en desktop */
  .hero__inner {
    flex-direction: row;
    align-items: center;
    gap: 3rem;
    padding-block: 6rem 4rem;
  }
  .hero__content {
    text-align: left;
    max-width: 560px;
    transform: translateX(-3cm); /* desplaza el bloque de texto 3 cm a la izquierda */
  }
  .hero__subtitle  { margin-inline: 0; }
  .hero__buttons   { justify-content: flex-start; }
  .hero__trust     { justify-content: flex-start; flex-wrap: nowrap; margin-top: 2cm; }
  .hero__logo-wrap {
    justify-content: flex-end;
    align-self: flex-end;   /* alinea el logo con la parte baja del contenedor (altura de los trust items) */
    padding-right: 1.5rem;
  }
  .hero__logo {
    width: clamp(300px, 34vw, 460px);
    transform: translate(5cm, 3cm); /* 5 cm derecha, 3 cm abajo */
  }

  /* Mostrar nav desktop, ocultar hamburguesa */
  .nav        { display: flex; align-items: center; }
  .hamburger  { display: none; }
  .mobile-nav { display: none !important; }
  .header__phone { display: block; }

  /* Ocultar botón "Llamar ahora" en cabecera si ya está el teléfono visible */
  .header__actions .btn--sm { display: inline-flex; }

  .services__grid { grid-template-columns: repeat(3, 1fr); }
  .projects__grid { grid-template-columns: repeat(3, 1fr); }

  .about__inner {
    grid-template-columns: 58fr 42fr;
    gap: 4rem;
    align-items: start;
  }
  .about__photo {
    padding-top: 3.5rem;
  }

  /* Contacto: tarjetas en fila y botones en fila en desktop */
  .contact__items       { flex-direction: row; justify-content: center; }
  .contact__big-buttons { flex-direction: row; justify-content: center; }

  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
  .footer__brand,
  .footer__contact { text-align: left; }
  .footer__contact { align-items: flex-start; }
  .footer__links nav { justify-content: flex-start; }

  .urgency__inner {
    flex-direction: row;
    text-align: left;
    justify-content: space-between;
  }
  .urgency__buttons {
    flex-direction: row;
    max-width: none;
    width: auto;
  }
}

/* Texto solo para lectores de pantalla y buscadores (invisible visualmente) */
.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;
}

/* ============================================================
   ANIMACIÓN DE ENTRADA (IntersectionObserver)
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}
