/* ============================================================
   BEN SGHIR — Climatización · Calefacción · Fontanería
   Estilo claro corporativo · Acentos azul/naranja del logotipo
   ============================================================ */

:root {
  --blue: #0e5fa8;
  --blue-dark: #083d6e;
  --blue-ink: #0d1b2a;
  --orange: #f0762c;
  --green-wa: #25d366;
  --green-wa-dark: #1cab53;
  --bg: #ffffff;
  --bg-soft: #f4f7fb;
  --text: #243447;
  --text-soft: #5b6b7d;
  --radius: 20px;
  --shadow: 0 24px 60px -24px rgba(8, 61, 110, 0.28);
  --font-head: "Sora", sans-serif;
  --font-body: "Inter", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-head); color: var(--blue-ink); line-height: 1.12; }

img, video { display: block; max-width: 100%; }

a { text-decoration: none; color: inherit; }

.container { width: min(1140px, 92%); margin: 0 auto; }

.kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 14px;
}

.section-sub { color: var(--text-soft); font-size: 1.08rem; max-width: 560px; }

/* ---------- Animación de aparición ---------- */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 14px 26px;
  border-radius: 999px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-whatsapp {
  background: var(--green-wa);
  color: #fff;
  box-shadow: 0 14px 34px -12px rgba(37, 211, 102, 0.65);
}
.btn-whatsapp:hover { background: var(--green-wa-dark); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.26); }

.btn-ghost-dark {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.btn-ghost-dark:hover { background: rgba(255, 255, 255, 0.22); }

.btn-nav {
  background: var(--blue);
  color: #fff;
  padding: 10px 22px;
  font-size: 0.88rem;
  box-shadow: 0 10px 24px -10px rgba(14, 95, 168, 0.6);
}
.btn-nav:hover { background: var(--blue-dark); }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 14px 0;
  transition: background 0.35s ease, box-shadow 0.35s ease, padding 0.35s ease;
}
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px -18px rgba(8, 61, 110, 0.35);
  padding: 8px 0;
}
.navbar-inner {
  width: min(1180px, 94%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  height: 46px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.3);
}
.brand-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: #fff;
  transition: color 0.35s ease;
}
.brand-name em { font-style: normal; color: var(--orange); }
.navbar.scrolled .brand-name { color: var(--blue-ink); }

.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  transition: color 0.3s ease;
}
.nav-links a:hover { color: var(--orange); }
.navbar.scrolled .nav-links a { color: var(--text); }
.navbar.scrolled .nav-links a:hover { color: var(--blue); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 25, 45, 0.55) 0%, rgba(8, 25, 45, 0.35) 45%, rgba(8, 25, 45, 0.75) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: min(860px, 92%);
  padding: 120px 0 80px;
}
.hero-kicker {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #ffc89e;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 22px;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
}
.hero-sub {
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 2vw, 1.18rem);
  max-width: 620px;
  margin: 0 auto 36px;
}
.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}
.hero-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 38px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
}

.scroll-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  z-index: 2;
}
.scroll-hint span {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: #fff;
  animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 0; transform: translateY(0); }
}

/* ============================================================
   FRANJA DE CONFIANZA
   ============================================================ */
.trust { background: var(--blue-ink); padding: 34px 0; }
.trust-inner {
  width: min(1140px, 92%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.trust-item strong {
  display: block;
  font-family: var(--font-head);
  color: #fff;
  font-size: 1.02rem;
}
.trust-item span { color: rgba(255, 255, 255, 0.6); font-size: 0.85rem; }

/* ============================================================
   SERVICIOS
   ============================================================ */
.services-intro { padding: 72px 0 20px; text-align: center; }
.services-intro h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); font-weight: 800; margin-bottom: 18px; }
.services-intro .section-sub { margin: 0 auto; }

.service { position: relative; }
.service-sticky {
  min-height: 72svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 30px 0;
}
.service-alt .service-sticky { background: var(--bg-soft); }

.service-grid {
  width: min(1140px, 92%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  align-items: center;
  gap: clamp(30px, 6vw, 80px);
}
.service-alt .service-grid { direction: rtl; }
.service-alt .service-grid > * { direction: ltr; }

.service-num {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.2em;
}
.service-text h3 {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 800;
  margin: 10px 0 14px;
}
.service-tagline { color: var(--blue); font-weight: 600; font-size: 1.08rem; margin-bottom: 20px; }
.service-list { list-style: none; margin-bottom: 28px; }
.service-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  color: var(--text-soft);
}
.service-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--orange);
  font-weight: 700;
}
.service-cta {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--blue);
  border-bottom: 2px solid var(--orange);
  padding-bottom: 3px;
  transition: color 0.25s ease;
}
.service-cta:hover { color: var(--orange); }

.service-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 5;
  max-height: 76svh;
  background: #dde6ef;
}
.service-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.service-progress {
  display: none;
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
}
.service-progress i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--blue), var(--orange));
}

/* ============================================================
   POR QUÉ NOSOTROS
   ============================================================ */
.why { padding: 120px 0; background: var(--bg); }
.why-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: center;
}
.why h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; margin-bottom: 18px; }
.why-points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  margin-top: 40px;
}
.why-point strong {
  display: block;
  font-family: var(--font-head);
  color: var(--blue-ink);
  margin-bottom: 4px;
}
.why-point span { color: var(--text-soft); font-size: 0.93rem; }

.why-logo img {
  width: min(330px, 80%);
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ============================================================
   GALERÍA / TRABAJOS REALIZADOS
   ============================================================ */
.gallery { padding: 70px 0; background: var(--bg); }
.gallery-head { text-align: center; margin-bottom: 34px; }
.gallery-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; margin-bottom: 14px; }
.gallery-head .section-sub { margin: 0 auto; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.gallery-item {
  position: relative;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow);
  cursor: default;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-item:hover img { transform: scale(1.07); }
.gallery-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 30px 18px 16px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.98rem;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(8, 25, 45, 0.82));
}

/* ============================================================
   RESEÑAS
   ============================================================ */
.reviews { padding: 70px 0; background: var(--bg-soft); }
.reviews-head { text-align: center; margin-bottom: 34px; }
.reviews-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; margin-bottom: 14px; }
.reviews-head .section-sub { margin: 0 auto; }

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.review {
  background: #fff;
  border: 1px solid #e6edf4;
  border-radius: 16px;
  padding: 20px 20px;
  box-shadow: 0 14px 32px -26px rgba(8, 61, 110, 0.35);
  display: flex;
  flex-direction: column;
}
.review .stars { color: #f5a623; letter-spacing: 1px; font-size: 0.92rem; margin-bottom: 10px; }
.review .stars .star-empty { color: #d4dde6; }
.review-text { color: var(--text); font-size: 0.92rem; line-height: 1.55; flex-grow: 1; }
.review-author {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 16px;
}
.review-author .avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px -2px rgba(8, 61, 110, 0.4);
}
.review-author strong { display: block; font-family: var(--font-head); color: var(--blue-ink); font-size: 0.92rem; }
.review-author span { color: var(--text-soft); font-size: 0.82rem; }

/* ============================================================
   UBICACIÓN — Globo 3D + mapa de Melilla
   ============================================================ */
.location { padding: 78px 0; background: var(--bg-soft); overflow: hidden; }
.location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
.location h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; margin-bottom: 18px; }

.location-info { margin-top: 34px; }
.location-pin {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #e3eaf2;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 14px 34px -22px rgba(8, 61, 110, 0.4);
  max-width: 340px;
}
.location-pin svg { color: var(--orange); flex-shrink: 0; }
.location-pin strong { display: block; font-family: var(--font-head); color: var(--blue-ink); }
.location-pin span { color: var(--text-soft); font-size: 0.9rem; }
.location-hint { margin-top: 16px; font-size: 0.88rem; color: var(--text-soft); }

.location-visual { display: flex; flex-direction: column; align-items: center; }

.globe-stage {
  position: relative;
  width: min(420px, 80vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  cursor: pointer;
  isolation: isolate;
}
.globe-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.melilla-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.9), 0 30px 60px -28px rgba(8, 61, 110, 0.55);
  z-index: 2;
}
.globe-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(14, 95, 168, 0.25);
  animation: globe-spin 26s linear infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes globe-spin { to { transform: rotate(360deg); } }

/* Estado activo: el globo deja paso al mapa */
.globe-stage.is-map .globe-canvas { opacity: 0; transform: scale(1.12); }
.globe-stage.is-map .melilla-map { opacity: 1; transform: scale(1); pointer-events: auto; }
.globe-stage.is-map .globe-ring { border-color: rgba(240, 118, 44, 0.4); }

.globe-label {
  margin-top: 20px;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.04em;
  transition: color 0.4s ease;
}
.globe-stage.is-map ~ .globe-label { color: var(--orange); }

.melilla-map .leaflet-control-attribution {
  font-size: 9px;
  background: rgba(255, 255, 255, 0.7);
}
.melilla-map .leaflet-control-zoom { display: none; }

/* ============================================================
   CTA BAND / CONTACTO
   ============================================================ */
.cta-band {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, #1273c4 100%);
  padding: 76px 0;
  text-align: center;
  color: #fff;
}
.cta-band h2 {
  color: #fff;
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  font-weight: 800;
  margin-bottom: 16px;
}
.cta-band p { color: rgba(255, 255, 255, 0.85); margin-bottom: 36px; font-size: 1.08rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--blue-ink); color: rgba(255, 255, 255, 0.75); padding: 70px 0 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 50px;
}
.footer-brand img { width: 110px; border-radius: 12px; margin-bottom: 16px; }
.footer-brand p { font-size: 0.9rem; line-height: 1.7; }
.footer-links, .footer-contact { display: flex; flex-direction: column; gap: 12px; }
.footer-links a, .footer-contact a { font-size: 0.92rem; transition: color 0.25s ease; }
.footer-links a:hover, .footer-contact a:hover { color: var(--orange); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 22px 0;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
}
.footer-bottom a { text-decoration: underline; }
.footer-bottom a:hover { color: var(--orange); }

/* ============================================================
   BOTÓN FLOTANTE WHATSAPP
   ============================================================ */
.wa-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--green-wa);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px -8px rgba(37, 211, 102, 0.7);
  transition: transform 0.25s ease;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--green-wa);
  animation: wa-pulse 2s ease-out infinite;
}
@keyframes wa-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ============================================================
   PÁGINA LEGAL
   ============================================================ */
.legal { padding: 140px 0 90px; }
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 10px; }
.legal .updated { color: var(--text-soft); font-size: 0.88rem; margin-bottom: 40px; }
.legal h2 { font-size: 1.3rem; margin: 38px 0 12px; }
.legal p, .legal li { color: var(--text-soft); font-size: 0.97rem; }
.legal ul { padding-left: 22px; margin: 10px 0; }
.legal a { color: var(--blue); text-decoration: underline; }
.legal .back {
  display: inline-block;
  margin-top: 50px;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 2px solid var(--orange);
  padding-bottom: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .nav-links { display: none; }

  .service-grid,
  .service-alt .service-grid {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 26px;
    align-content: center;
  }
  .service-sticky { align-items: center; min-height: auto; padding: 70px 0 50px; }
  .service-media { aspect-ratio: 3 / 4; max-height: 52svh; order: -1; margin: 0 auto; width: 100%; max-width: 360px; }
  .service-text h3 { margin-top: 6px; }

  .trust-inner { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr; }
  .why-logo { order: -1; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }

  .location-grid { grid-template-columns: 1fr; gap: 36px; }
  .location-visual { order: -1; }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .reviews-grid { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .brand-name { display: none; }
  .btn-nav { padding: 9px 16px; font-size: 0.8rem; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-badges { flex-direction: column; gap: 6px; }
  .why-points { grid-template-columns: 1fr; }
  .trust-inner { grid-template-columns: 1fr 1fr; gap: 18px; }
  .wa-float { width: 56px; height: 56px; right: 16px; bottom: 16px; }
  .service-list li { font-size: 0.92rem; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
