/* RESET Y TIPOGRAFÍA */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #ffffff;
  color: #111111;
  line-height: 1.5;
}

/* ============================================
   HEADER
   ============================================ */
.custom-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(20px, 6vw, 100px);
  padding: 0px 40px;
  height: 70px;
  position: fixed;
  top: 0;
  width: 100%;
  background: #ffffff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
  border-bottom: 1px solid rgba(232, 160, 35, 0.30);
  z-index: 1000;
}

/* LOGO */
.logo-center img {
  height: 104px;
  width: auto;
  max-width: 260px;
  animation: logoPulse 3s infinite ease-in-out;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* HAMBURGER */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1100;
  flex-shrink: 0;
  margin-left: auto;
}

.hamburger span {
  width: 100%;
  height: 3px;
  background: #444;
  border-radius: 3px;
  transition: all 0.3s ease;
  display: block;
}

.hamburger.open span:nth-child(1) { transform: translateY(10.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-10.5px) rotate(-45deg); }

/* MENÚ LIMPIO */
.menu-right ul {
  list-style: none;
  display: flex;
  gap: 34px;
  align-items: center;
}

.menu-right ul li a {
  position: relative;
  display: inline-block;
  text-decoration: none;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.15em;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #1c1c1c;
  padding: 6px 4px;
  text-shadow:
    0 1px 0 #d9d9d9,
    0 2px 0 #bdbdbd,
    0 3px 3px rgba(0, 0, 0, 0.3);
  transition: color 0.3s ease, transform 0.3s ease, text-shadow 0.3s ease;
}

/* Subrayado dorado animado desde el centro */
.menu-right ul li a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e8a023, transparent);
  box-shadow: 0 0 6px rgba(232, 160, 35, 0.7);
  transition: width 0.35s ease, left 0.35s ease;
}

.menu-right ul li a:hover {
  color: #c8881a;
  transform: translateY(-2px);
  text-shadow:
    0 1px 0 #f5d28a,
    0 2px 0 #d99e2b,
    0 4px 6px rgba(232, 160, 35, 0.5);
}

.menu-right ul li a:hover::after {
  width: 100%;
  left: 0;
}

/* Anula gradiente de texto antiguo */
.menu-animated {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: #1c1c1c;
  animation: none;
}

/* OVERLAY */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 900;
}
.nav-overlay.active { display: block; }

/* ============================================
   MAIN
   ============================================ */
main {
  display: block;
  padding-top: 70px;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  width: 100%;
  height: 94vh;
  overflow: hidden;
  line-height: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 15% center;
}

/* ============================================
   NOSOTROS
   ============================================ */
.nosotros {
  padding: 80px 60px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, #1a1a1a 0%, #0a0a0a 100%);
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.nosotros .title-animated {
  font-size: clamp(1.8em, 4vw, 3em);
}

.nosotros p {
  width: 90%;
  max-width: 1000px;
  margin: 30px auto 0;
  text-align: justify;
  font-size: 1.08em;
  line-height: 1.9;
  color: #e6e6e6;
  font-weight: 700;
}

/* ============================================
   ANIMACIONES DE TÍTULOS
   ============================================ */
.title-animated {
  position: relative;
  display: inline-block;
  font-size: clamp(1.3em, 3vw, 2em);
  margin-bottom: 20px;
  text-align: center;
  background: linear-gradient(90deg, #f5c842, #e8a023, #f5c842);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 2px 0 rgba(120, 80, 0, 0.6))
    drop-shadow(0 4px 2px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 14px rgba(232, 160, 35, 0.6));
  animation: shimmer 2.5s linear infinite;
  letter-spacing: 1px;
}

.hidden-title {
  opacity: 0;
  transform: translateX(-50px);
}

.hidden-para {
  opacity: 0;
  transform: translateY(30px);
}

.show-para {
  animation: fadeInUp 0.9s ease forwards;
}

.show-title {
  animation: slideInLeft 1.2s ease forwards, shimmer 2.5s linear infinite;
}

@keyframes slideInLeft {
  0%   { opacity: 0; transform: translateX(-50px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInUp {
  0%   { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

@keyframes bgZoom {
  0%   { background-size: 150% 150%; background-position: 20% 20%; }
  25%  { background-size: 175% 175%; background-position: 80% 30%; }
  50%  { background-size: 160% 160%; background-position: 70% 80%; }
  75%  { background-size: 180% 180%; background-position: 20% 70%; }
  100% { background-size: 150% 150%; background-position: 20% 20%; }
}

.title-animated::after {
  content: "";
  position: absolute;
  left: 50%;
  right: auto;
  bottom: -10px;
  width: 0;
  height: 3px;
  background-color: #e8a023;
  transform: translateX(-50%);
  transition: width 0.6s ease;
}

.title-animated.animate-line::after {
  width: 100%;
  box-shadow: 0 0 8px #e8a023;
}

/* ============================================
   SERVICES OVERVIEW (slider)
   ============================================ */
.services {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 40px 40px 80px;
  background-image: url('img/FONDO.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  perspective: 1400px;
}

.services .title-animated {
  font-size: clamp(2em, 5vw, 3.6em);
}

/* Primera sección de servicios con encabezado principal */
.service-detail--first {
  flex-direction: column;
  gap: 14px;
  padding-top: 40px;
}

.services-main-title {
  font-size: clamp(1.7em, 4vw, 2.9em);
  align-self: center !important;
  text-align: center !important;
  margin: 0 auto !important;
  left: 90px;
  opacity: 1 !important;
  transform: none !important;
  animation: shimmer 2.5s linear infinite, titlePulse 3s ease-in-out infinite;
}

/* Subrayado interesante: barra degradada con glow que se desplaza */
.services-main-title::after {
  height: 4px !important;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent, #f5c842, #fff3cf, #f5c842, transparent) !important;
  background-size: 200% 100% !important;
  box-shadow: 0 0 12px rgba(245, 200, 100, 0.8) !important;
}

.services-main-title.animate-line::after {
  width: 80%;
  animation: underlineFlow 3s linear infinite;
}

@keyframes underlineFlow {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.services-main-title.animate-line::after {
  width: 100%;
}

@keyframes titlePulse {
  0%, 100% { filter:
    drop-shadow(0 2px 0 rgba(120,80,0,0.6))
    drop-shadow(0 4px 2px rgba(0,0,0,0.5))
    drop-shadow(0 0 10px rgba(232,160,35,0.5)); }
  50%      { filter:
    drop-shadow(0 2px 0 rgba(120,80,0,0.6))
    drop-shadow(0 4px 2px rgba(0,0,0,0.5))
    drop-shadow(0 0 26px rgba(245,200,100,0.9)); }
}

/* Quita subrayado de los demás títulos (solo NUESTROS SERVICIOS lo lleva) */
.service-text .title-animated::after {
  display: none;
}

/* Tarjeta del slider */
.card {
  border-radius: 18px;
  overflow: hidden;
  background-color: transparent;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(232, 160, 35, 0.4),
    0 0 35px rgba(232, 160, 35, 0.3);
  width: clamp(360px, 60%, 820px);
  max-height: 88vh;
  border: 3px solid #e8a023;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  cursor: pointer;
  transform: perspective(1400px) rotateX(2deg);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s ease;
}

.card:hover {
  transform: perspective(1400px) rotateX(0deg) translateY(-8px) scale(1.02);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(232, 160, 35, 0.6),
    0 0 55px rgba(232, 160, 35, 0.5);
}

.card img {
  width: 100%;
  height: auto;
  max-height: 88vh;
  display: block;
  object-fit: contain;
}

/* DOTS */
.slider-container { position: relative; }

.slider-dots {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  gap: 8px;
}

.slider-dots span {
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-radius: 50%;
  opacity: 0.5;
}

.slider-dots span.active { opacity: 1; }

/* ============================================
   SERVICE DETAIL SECTIONS
   ============================================ */
.service-detail {
  background: #000;
  padding: 70px 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  perspective: 1000px;
}

/* Altura uniforme (igual que la sección IA), salvo la primera */
.service-detail:not(.service-detail--first) {
  min-height: 90vh;
}

/* Fondos temáticos por profesión (tinte oscuro) */
#servicios { background: radial-gradient(circle at 50% 40%, #0d1a2b 0%, #050608 70%); }
#energias  { background: radial-gradient(circle at 50% 40%, #1c2410 0%, #050608 70%); }
#web       { background: radial-gradient(circle at 50% 40%, #1a1226 0%, #050608 70%); }
#domotica  { background: radial-gradient(circle at 50% 40%, #0c2422 0%, #050608 70%); }
#ia        { background: radial-gradient(circle at 50% 40%, #2a2008 0%, #050608 70%); }
#reparaciones { background: radial-gradient(circle at 50% 40%, #241a10 0%, #050608 70%); }
#diseno3d  { background: radial-gradient(circle at 50% 40%, #281612 0%, #050608 70%); }

/* Icono watermark animado (pseudo-elemento) */
.service-detail::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 300px;
  height: 300px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.72;
  z-index: 0;
  pointer-events: none;
  transform-style: preserve-3d;
  filter: drop-shadow(0 0 6px rgba(232, 160, 35, 0.35));
}

.service-content { position: relative; z-index: 2; }

/* Posiciones: derecha / izquierda alternadas */
#servicios::before,
#web::before,
#ia::before,
#diseno3d::before { right: 4%; left: auto; }

#energias::before,
#domotica::before,
#reparaciones::before { left: 4%; right: auto; }

/* 1. Redes/WiFi — derecha — flota + pulso de ondas */
#servicios::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23ffd36b'/%3E%3Cstop offset='1' stop-color='%23c8881a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23g)' stroke-width='5' stroke-linecap='round'%3E%3Cpath d='M30 62a28 28 0 0 1 40 0'/%3E%3Cpath d='M20 52a42 42 0 0 1 60 0'/%3E%3Cpath d='M40 72a14 14 0 0 1 20 0'/%3E%3C/g%3E%3Ccircle cx='50' cy='80' r='6' fill='url(%23g)'/%3E%3C/svg%3E");
  animation: floatY 6s ease-in-out infinite;
}

/* 2. Sol — izquierda — gira lento */
#energias::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3CradialGradient id='s'%3E%3Cstop offset='0' stop-color='%23ffe08a'/%3E%3Cstop offset='1' stop-color='%23e8a023'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='50' cy='50' r='18' fill='url(%23s)'/%3E%3Cg stroke='%23e8a023' stroke-width='5' stroke-linecap='round'%3E%3Cpath d='M50 14v-8M50 86v8M14 50H6M86 50h8M25 25l-6-6M75 25l6-6M25 75l-6 6M75 75l6 6'/%3E%3C/g%3E%3C/svg%3E");
  animation: spinSlow 22s linear infinite;
}

/* 3. Código/Web — derecha — flota + leve giro 3D */
#web::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 100'%3E%3Cdefs%3E%3ClinearGradient id='w' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23ffd36b'/%3E%3Cstop offset='1' stop-color='%23c8881a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='14' y='20' width='92' height='60' rx='6' fill='none' stroke='url(%23w)' stroke-width='4'/%3E%3Cg fill='none' stroke='url(%23w)' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='44,40 32,50 44,60'/%3E%3Cpolyline points='76,40 88,50 76,60'/%3E%3Cline x1='66' y1='36' x2='54' y2='64'/%3E%3C/g%3E%3C/svg%3E");
  animation: tilt3D 8s ease-in-out infinite;
}

/* 4. Cámara — izquierda — vigila (swing) */
#domotica::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='c' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23ffd36b'/%3E%3Cstop offset='1' stop-color='%23c8881a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23c)' stroke-width='4' stroke-linejoin='round'%3E%3Crect x='18' y='36' width='46' height='26' rx='5'/%3E%3Cpath d='M64 43l16-8v30l-16-8z'/%3E%3Ccircle cx='32' cy='49' r='6' fill='url(%23c)' stroke='none'/%3E%3Cpath d='M40 62l-8 18'/%3E%3C/g%3E%3C/svg%3E");
  animation: camSwing 7s ease-in-out infinite;
  transform-origin: 50% 30%;
}

/* 5. Agente IA — derecha — pulso glow */
#ia::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23ffe08a'/%3E%3Cstop offset='1' stop-color='%23c8881a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23a)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='30' y='34' width='40' height='34' rx='10'/%3E%3Ccircle cx='42' cy='51' r='4' fill='url(%23a)' stroke='none'/%3E%3Ccircle cx='58' cy='51' r='4' fill='url(%23a)' stroke='none'/%3E%3Cpath d='M44 60h12'/%3E%3Cpath d='M50 34V24M50 24a5 5 0 1 0 0-.01'/%3E%3Cpath d='M30 46h-7M77 46h-7M30 58h-7M77 58h-7'/%3E%3C/g%3E%3C/svg%3E");
  animation: pulseGlow 4.5s ease-in-out infinite;
}

/* 6. Portátil (Reparación y Mantenimiento de Computadores) — izquierda — flota + leve giro */
#reparaciones::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='l' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23ffd36b'/%3E%3Cstop offset='1' stop-color='%23c8881a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23l)' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='28' y='24' width='44' height='30' rx='3'/%3E%3Cpath d='M28 46h44'/%3E%3Cpath d='M16 74h68l-8-14H24z'/%3E%3Cpath d='M44 66h12'/%3E%3C/g%3E%3C/svg%3E");
  animation: tilt3D 8s ease-in-out infinite;
}

/* 7. Bombillo 3D (Soluciones Creativas) — izquierda — pulso glow */
#diseno3d::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3CradialGradient id='b' cx='0.4' cy='0.35'%3E%3Cstop offset='0' stop-color='%23ffe9a8'/%3E%3Cstop offset='1' stop-color='%23c8881a'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M50 16a24 24 0 0 1 14 43c-3 2-4 5-4 8H40c0-3-1-6-4-8a24 24 0 0 1 14-43z' fill='url(%23b)'/%3E%3Cg fill='none' stroke='%23c8881a' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M42 72h16M44 80h12M47 87h6'/%3E%3C/g%3E%3Cg stroke='%23fff4d6' stroke-width='2.5' stroke-linecap='round' opacity='0.7'%3E%3Cpath d='M50 34v22M50 44l-7-6M50 44l7-6'/%3E%3C/g%3E%3Cg stroke='url(%23b)' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M50 8V2M22 22l-4-4M78 22l4-4M16 48h-6M90 48h-6'/%3E%3C/g%3E%3C/svg%3E");
  animation: pulseGlow 4.5s ease-in-out infinite;
}

/* === Animaciones de iconos === */
@keyframes floatY {
  0%,100% { transform: translateY(-50%) translateY(0); }
  50%     { transform: translateY(-50%) translateY(-22px); }
}
@keyframes spinSlow {
  0%   { transform: translateY(-50%) rotate(0deg); }
  100% { transform: translateY(-50%) rotate(360deg); }
}
@keyframes tilt3D {
  0%,100% { transform: translateY(-50%) rotateY(-18deg) rotateX(6deg); }
  50%     { transform: translateY(-50%) rotateY(18deg) rotateX(-6deg); }
}
@keyframes camSwing {
  0%,100% { transform: translateY(-50%) rotate(-12deg); }
  50%     { transform: translateY(-50%) rotate(12deg); }
}
@keyframes pulseGlow {
  0%,100% { transform: translateY(-50%) scale(1);    opacity: 0.45; filter: drop-shadow(0 0 0 rgba(232,160,35,0)); }
  50%     { transform: translateY(-50%) scale(1.12); opacity: 0.7;  filter: drop-shadow(0 0 22px rgba(232,160,35,0.6)); }
}
@keyframes spinY {
  0%   { transform: translateY(-50%) rotateY(0deg); }
  100% { transform: translateY(-50%) rotateY(360deg); }
}

/* Variante: invierte imagen y texto */
.service-detail--alt .service-content {
  flex-direction: row-reverse;
}

.service-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  max-width: 1200px;
  width: 100%;
  perspective: 1600px;
}

.service-card-wrap {
  flex: 0 0 auto;
  width: clamp(180px, 24%, 320px);
  height: auto;
  background: #000;
  border-radius: 18px;
  border: 3px solid #e8a023;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(232, 160, 35, 0.35),
    0 0 30px rgba(232, 160, 35, 0.25);
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s ease;
  transform: perspective(1600px) rotateY(6deg);
}

.service-detail--alt .service-card-wrap {
  transform: perspective(1600px) rotateY(-6deg);
}

.service-card-wrap:hover {
  transform: perspective(1600px) rotateY(0deg) translateY(-10px) scale(1.03);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(232, 160, 35, 0.6),
    0 0 55px rgba(232, 160, 35, 0.45);
}

.service-card-wrap img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Link wrapper de tarjeta de servicio */
.service-card-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
  line-height: 0;
  font-size: 0;
  width: 100%;
  height: 100%;
}

.service-card-link img {
  width: 100%;
  height: auto;
  display: block;
}

.img-fade {
  transition: opacity 0.4s ease;
}

/* Tarjetas con imágenes intercaladas: tamaño fijo */
#servicios .service-card-wrap,
#diseno3d .service-card-wrap {
  aspect-ratio: 4 / 5;
  height: auto;
}

#servicios .service-card-wrap img,
#servicios .service-card-link,
#diseno3d .service-card-wrap img,
#diseno3d .service-card-link {
  width: 100%;
  height: 100%;
}

#servicios .service-card-wrap img,
#diseno3d .service-card-wrap img {
  object-fit: cover;
  object-position: center;
}

/* Tarjetas más altas verticalmente (IA, CCTV, Energías, Web) */
#ia .service-card-wrap,
#domotica .service-card-wrap,
#energias .service-card-wrap,
#web .service-card-wrap,
#reparaciones .service-card-wrap {
  aspect-ratio: 5 / 6;
  height: auto;
}

#ia .service-card-wrap img,
#ia .service-card-link,
#domotica .service-card-wrap img,
#domotica .service-card-link,
#energias .service-card-wrap img,
#energias .service-card-link,
#web .service-card-wrap img,
#web .service-card-link,
#reparaciones .service-card-wrap img,
#reparaciones .service-card-link {
  width: 100%;
  height: 100%;
}

#ia .service-card-wrap img,
#domotica .service-card-wrap img,
#energias .service-card-wrap img,
#web .service-card-wrap img,
#reparaciones .service-card-wrap img {
  object-fit: cover;
  object-position: center;
}

.service-text {
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 8px;
}

.service-detail--alt .service-text {
  text-align: right;
}

.service-detail--alt .service-text p {
  margin-left: auto;
  margin-right: 0;
}

.service-text .title-animated {
  font-size: clamp(1.5em, 2.9vw, 2.2em);
  text-align: center;
  margin-bottom: 0;
  max-width: 560px;
  width: 100%;
  align-self: flex-start;
}

.service-detail--alt .service-text .title-animated {
  margin-left: auto;
  margin-right: 0;
  align-self: flex-end;
}

.service-text p {
  font-size: clamp(1em, 1.5vw, 1.15em);
  line-height: 1.85;
  color: #ddd;
  text-align: justify;
  max-width: 560px;
  font-weight: 700;
}


/* ============================================
   WHATSAPP
   ============================================ */
.icono-whatsapp {
  width: 80px;
  height: 80px;
  transition: transform 0.3s ease;
  display: block;
}

.icono-whatsapp:hover { transform: scale(1.12); }

/* ============================================
   FOOTER
   ============================================ */
.footer-bordered {
  background-color: #000;
  color: #f8f8f8;
  padding: 30px;
  font-size: 1.1em;
  text-align: center;
  border-top: 3px solid #e8a023;
}

/* ============================================
   RESPONSIVE — MÓVIL PEQUEÑO (≤480px)
   ============================================ */
@media (max-width: 480px) {
  .custom-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    padding: 6px 16px;
    gap: 12px;
  }

  .logo-center {
    grid-column: 2;
    justify-self: center;
  }

  .logo-center img {
    height: 56px;
    max-width: 145px;
  }

  .hamburger {
    display: flex;
    grid-column: 3;
    justify-self: end;
    margin-left: 0;
  }

  .menu-right {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(78vw, 300px);
    background: #ffffff;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.25);
    transform: translateX(100%);
    transition: transform 0.35s ease;
    z-index: 1100;
    padding-top: 90px;
  }

  .menu-right.nav-open { transform: translateX(0); }

  .menu-right ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 0 28px;
    width: 100%;
  }

  .menu-right ul li { width: 100%; }

  .menu-right ul li a {
    display: block;
    width: 100%;
    font-size: 0.95em;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  main { padding-top: 62px; }

  .hero { height: auto; min-height: 0; aspect-ratio: 1960 / 872; }
  .hero-image { height: 100%; width: 100%; object-fit: cover; object-position: center; }

  .nosotros {
    padding: 40px 16px;
    min-height: auto;
  }

  .nosotros p {
    font-size: 0.88em;
    width: 96%;
    line-height: 1.7;
  }

  .title-animated { font-size: 1.1em; }

  .services { padding: 28px 12px 40px; }

  .card {
    width: 88%;
    height: auto;
    aspect-ratio: 4 / 5;
  }

  .card img { height: 100%; object-fit: cover; }

  /* Secciones: 2 columnas como PC, sin huecos */
  .service-detail,
  .service-detail:not(.service-detail--first) {
    min-height: auto;
    padding: 40px 14px;
  }

  .service-detail::before {
    width: 110px;
    height: 110px;
    opacity: 0.18;
  }

  .service-detail--first { gap: 18px; }

  .services-main-title { transform: none; left: 0; font-size: 1.5em; }

  /* Tarjeta arriba, texto abajo: evita párrafos más altos que la imagen */
  .service-content,
  .service-detail--alt .service-content {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  .service-card-wrap,
  .service-detail--alt .service-card-wrap {
    width: min(62%, 230px);
    transform: none;
  }

  .service-card-wrap img { height: auto; }

  .service-text,
  .service-detail--alt .service-text {
    padding: 0 2px;
    align-items: center;
    text-align: center;
  }

  .service-text .title-animated,
  .service-detail--alt .service-text .title-animated {
    align-self: center;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .service-text p,
  .service-detail--alt .service-text p {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.86em;
    line-height: 1.55;
    text-align: justify !important;
  }
}

/* ============================================
   RESPONSIVE — MÓVIL GRANDE (481px – 768px)
   ============================================ */
@media (min-width: 481px) and (max-width: 768px) {
  .custom-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    padding: 8px 20px;
    gap: 16px;
  }

  .logo-center {
    grid-column: 2;
    justify-self: center;
  }

  .logo-center img {
    height: 68px;
    max-width: 165px;
  }

  .hamburger {
    display: flex;
    grid-column: 3;
    justify-self: end;
    margin-left: 0;
  }

  .menu-right {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(60vw, 320px);
    background: #ffffff;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.25);
    transform: translateX(100%);
    transition: transform 0.35s ease;
    z-index: 1100;
    padding-top: 100px;
  }

  .menu-right.nav-open { transform: translateX(0); }

  .menu-right ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 0 32px;
    width: 100%;
  }

  .menu-right ul li { width: 100%; }

  .menu-right ul li a {
    display: block;
    width: 100%;
    font-size: 1.05em;
    padding: 16px 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  main { padding-top: 76px; }

  .hero { height: auto; min-height: 0; aspect-ratio: 1960 / 872; }
  .hero-image { height: 100%; width: 100%; object-fit: cover; object-position: center; }

  .nosotros {
    padding: 50px 20px;
    min-height: auto;
  }

  .nosotros p {
    font-size: 0.94em;
    width: 94%;
  }

  .title-animated { font-size: 1.2em; }

  .services { padding: 32px 16px 48px; }

  .card { width: 70%; height: auto; aspect-ratio: 4 / 5; }
  .card img { height: 100%; object-fit: cover; }

  .service-detail,
  .service-detail:not(.service-detail--first) {
    min-height: auto;
    padding: 48px 24px;
  }

  .service-detail::before {
    width: 150px;
    height: 150px;
    opacity: 0.2;
  }

  .service-detail--first { gap: 22px; }

  .services-main-title { transform: none; left: 0; font-size: 1.8em; }

  /* Tarjeta arriba, texto abajo: evita párrafos más altos que la imagen */
  .service-content,
  .service-detail--alt .service-content {
    flex-direction: column;
    align-items: center;
    gap: 22px;
  }

  .service-card-wrap,
  .service-detail--alt .service-card-wrap {
    width: min(52%, 280px);
    transform: none;
  }

  .service-card-wrap img { height: auto; }

  .service-text,
  .service-detail--alt .service-text {
    align-items: center;
    text-align: center;
  }

  .service-text .title-animated,
  .service-detail--alt .service-text .title-animated {
    align-self: center;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .service-text p,
  .service-detail--alt .service-text p {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.9em;
    line-height: 1.7;
    text-align: justify !important;
  }
}

/* ============================================
   RESPONSIVE — TABLET (769px – 1024px)
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  .custom-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    padding: 0px 20px;
    gap: 10px;
  }

  .logo-center {
    grid-column: 2;
    justify-self: center;
  }

  .logo-center img {
    height: 88px;
    max-width: 190px;
  }

  .hamburger { grid-column: 3; justify-self: end; }

  .menu-right {
    grid-column: 3;
    justify-self: end;
    min-width: 0;
  }

  .menu-right ul { gap: 10px; flex-wrap: nowrap; }

  .menu-right ul li a {
    font-size: 0.8em;
    letter-spacing: 0.5px;
    padding: 6px 2px;
    white-space: nowrap;
  }

  main { padding-top: 98px; }

  .hero { height: auto; min-height: 0; max-height: none; aspect-ratio: 1960 / 872; }
  .hero-image { width: 100%; height: 100%; object-fit: cover; object-position: center; }

  .nosotros { padding: 60px 30px; min-height: auto; }

  .nosotros p { font-size: 1em; }

  .title-animated { font-size: 1.4em; }

  .services { padding: 36px 24px 60px; }

  .card { width: 55%; height: auto; aspect-ratio: 4 / 5; }
  .card img { height: 100%; object-fit: cover; }

  .service-detail,
  .service-detail:not(.service-detail--first) {
    min-height: auto;
    padding: 56px 40px;
  }

  .service-detail::before {
    width: 180px;
    height: 180px;
    opacity: 0.22;
  }

  .service-content { gap: 28px; }

  .service-card-wrap {
    width: clamp(200px, 36%, 320px);
    height: auto;
  }

  .service-text p {
    max-width: 420px;
    font-size: 0.98em;
    text-align: justify !important;
  }
}

/* ============================================
   RESPONSIVE — DESKTOP GRANDE (1281px+)
   ============================================ */
@media (min-width: 1281px) {
  .custom-header {
    padding: 0px 80px;
    gap: clamp(30px, 5vw, 100px);
  }

  .logo-center img {
    height: 100px;
    max-width: 240px;
  }

  main { padding-top: 70px; }

  .menu-right ul { gap: 44px; }

  .service-detail { padding: 80px 100px; }

  .service-content { gap: 60px; max-width: 1300px; }

  .service-card-wrap { width: clamp(240px, 30%, 400px); }

  .nosotros p { font-size: 1.12em; max-width: 960px; }
}

/* ============================================
   RESPONSIVE — ULTRA-WIDE (1600px+)
   ============================================ */
@media (min-width: 1600px) {
  .custom-header { padding: 0px 120px; }

  .logo-center img { height: 110px; max-width: 260px; }

  main { padding-top: 70px; }

  .service-content { max-width: 1480px; }

  .service-card-wrap { width: clamp(260px, 28%, 420px); }

  .card { width: clamp(300px, 42%, 560px); }
}
