:root {
  --primary-color: #1e3a8a;
  --secondary-color: #3b82f6;
  --accent-color: #f59e0b;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f8fafc;
  --white: #ffffff;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  padding-top: 100px; /* Compensar la altura de la navbar fija */
}

/* Ajuste para navegación fija - evitar que tape los títulos */
#servicios {
  scroll-margin-top: 150px;
  padding-top: 80px !important;
  padding-bottom: 200px !important;

}

#nosotros {
  scroll-margin-top: 150px;
  padding-top: 80px !important;
  padding-bottom: 200px !important;

}

#contacto {
  scroll-margin-top: 150px;
  padding-top: 80px !important;
}

#inicio {
  scroll-margin-top: 80px; /* Ajustar para que no se oculte la imagen */
}

.navbar {
  background: #000000 !important;
  box-shadow: 0 2px 15px rgba(0,0,0,0.3);
  padding: 0.5rem 0;
  min-height: 70px;
  transition: all 0.3s ease;
}

/* Efecto de scroll - cabecera reducida */
.navbar.scrolled {
  padding: 0.5rem 0;
  min-height: 35px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.2);
}

/* Asegurar que el logo se reduzca en la cabecera scrolled */
.navbar.scrolled .navbar-brand {
  display: flex;
  align-items: center;
}

.navbar.scrolled .navbar-brand img {
  height: 80px !important;
  width: auto;
  transition: all 0.3s ease;
}

.navbar.scrolled .navbar-caption {
  font-size: 0.5rem;
  transition: all 0.3s ease;
}

.navbar.scrolled .navbar-brand {
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-logo img {
  height: 20px;
  width: auto;
}

.navbar-caption {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff !important;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.nav-link {
  font-weight: 500;
  color: #ffffff !important;
  padding: 0.75rem 1.5rem !important;
  margin: 0 0.25rem;
  border-radius: 25px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.nav-link:hover {
  color: #ffffff !important;
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.3),
    0 0 20px rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.nav-link:hover::before {
  left: 100%;
}

.nav-link.active {
  background: var(--secondary-color);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Mejorar el botón hamburguesa */
.navbar-toggler {
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  padding: 0.5rem;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.2);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
  border-color: var(--secondary-color);
  background: rgba(0, 0, 0, 0.3);
}

.navbar-toggler-icon {
  background-image: none;
  width: 1.5em;
  height: 1.5em;
  position: relative;
  display: block;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 1px;
  transition: all 0.3s ease;
}

.navbar-toggler-icon::before {
  top: 6px;
}

.navbar-toggler-icon::after {
  bottom: 6px;
}

/* Línea central */
.navbar-toggler-icon {
  background: #ffffff;
  height: 2px;
  width: 18px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.navbar-toggler:hover {
  border-color: var(--secondary-color);
  background: rgba(59, 130, 246, 0.2);
  transform: scale(1.05);
}

.hero-section {
  background: #1e3a8a; /* Color de respaldo */
  color: var(--white);
  padding: 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* Imagen de fondo cargada desde HTML */
.hero-background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: 
    brightness(0.7) 
    contrast(1.2) 
    saturate(0.8) 
    blur(1px);
  transform: scale(1.05);
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.hero-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    /* Efecto de viñeta para enfocar el centro */
    radial-gradient(ellipse at center, transparent 20%, rgba(0, 0, 0, 0.2) 80%),
    /* Efecto de contraste mejorado */
    linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 0.1) 100%);
  z-index: 1;
  pointer-events: none;
}


@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(1deg); }
}

@keyframes backgroundShift {
  0%, 100% { transform: translateX(0) translateY(0); }
  25% { transform: translateX(-10px) translateY(-5px); }
  50% { transform: translateX(10px) translateY(5px); }
  75% { transform: translateX(-5px) translateY(10px); }
}

.hero-content {
  position: relative;
  z-index: 3;
  animation: fadeInUp 1s ease-out;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

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

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
  text-shadow: 
    4px 4px 8px rgba(0, 0, 0, 0.9),
    0 0 20px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease-out 0.2s both;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 2rem;
  opacity: 0.95;
  text-shadow: 
    3px 3px 6px rgba(0, 0, 0, 0.9),
    0 0 15px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(0, 0, 0, 0.5),
    0 0 45px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease-out 0.4s both;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
}

.hero-section .btn {
  animation: fadeInUp 1s ease-out 0.6s both;
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.1);
}

.hero-section .btn:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 8px 30px rgba(0, 0, 0, 0.7),
    0 0 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.2);
}

/* Elementos decorativos del sector - Herramientas de fontanería */
.hero-section .decorative-elements {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
}

/* Elementos decorativos sutiles */
.hero-section .decorative-elements::before {
  content: '🔧';
  position: absolute;
  top: 15%;
  left: 8%;
  font-size: 3rem;
  opacity: 0.3;
  animation: float 6s ease-in-out infinite;
  text-shadow: 0 4px 15px rgba(0,0,0,0.7);
}

.hero-section .decorative-elements::after {
  content: '⚙️';
  position: absolute;
  top: 70%;
  right: 12%;
  font-size: 2.5rem;
  opacity: 0.3;
  animation: float 8s ease-in-out infinite reverse;
  text-shadow: 0 4px 15px rgba(0,0,0,0.7);
}

/* Elementos de fondo sutiles para no interferir con la imagen */
.hero-section .decorative-elements {
  background: none;
  opacity: 0.3;
}

/* Patrón de tuberías sutil */
.hero-section .pipe-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: none;
  opacity: 0.2;
  z-index: 2;
  animation: backgroundShift 25s ease-in-out infinite;
}

/* Elementos decorativos sutiles */
.hero-section .pipe-pattern::before {
  content: '🔩';
  position: absolute;
  top: 25%;
  left: 15%;
  font-size: 2rem;
  opacity: 0.2;
  animation: float 7s ease-in-out infinite;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

.hero-section .pipe-pattern::after {
  content: '⚡';
  position: absolute;
  top: 75%;
  right: 20%;
  font-size: 1.5rem;
  opacity: 0.2;
  animation: float 9s ease-in-out infinite reverse;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}


.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
  text-align: center;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 3rem;
}

.service-card {
  background: var(--white);
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.service-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: var(--bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-icon img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.service-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.service-description {
  color: var(--text-light);
  line-height: 1.6;
}

.about-section {
  background: var(--bg-light);
  padding: 5rem 0;
}

.about-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-dark);
}

.contact-section {
  background: var(--primary-color);
  color: var(--white);
  padding: 5rem 0;
}

.contact-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.contact-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Nuevos estilos para tarjetas de contacto */
.contact-icon {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.contact-card-title {
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.contact-card-text {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.contact-card-text a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
}

.contact-card-text a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.contact-card small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}

/* Botón de volver arriba */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.back-to-top:hover {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Aviso de Cookies */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: var(--white);
  padding: 1rem 0;
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.cookie-text {
  font-size: 0.9rem;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

.cookie-link {
  color: var(--accent-color);
  text-decoration: underline;
  font-weight: 500;
}

.cookie-link:hover {
  color: var(--white);
}

.cookie-buttons {
  margin-top: 0.5rem;
}

@media (max-width: 991px) {
  .cookie-banner .col-lg-4 {
    text-align: center;
    margin-top: 1rem;
  }
  
  .cookie-buttons {
    margin-top: 0;
  }
}

/* Página Legal */
.legal-section {
  padding: 120px 0 80px 0;
  background: var(--bg-light);
  min-height: 100vh;
}

.legal-content {
  background: var(--white);
  border-radius: 15px;
  padding: 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.legal-title {
  color: var(--primary-color);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

.legal-subtitle {
  color: var(--text-light);
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 3rem;
  font-weight: 500;
}

.legal-section-content {
  margin-bottom: 2.5rem;
}

.legal-section-content h2 {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

.legal-section-content h3 {
  color: var(--text-dark);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem 0;
}

.legal-section-content p {
  color: var(--text-dark);
  line-height: 1.7;
  margin-bottom: 1rem;
  text-align: justify;
}

.legal-section-content ul {
  color: var(--text-dark);
  line-height: 1.7;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-section-content li {
  margin-bottom: 0.5rem;
}

.legal-footer {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 10px;
  margin-top: 3rem;
  text-align: center;
}

.legal-footer p {
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

/* Logo en la cabecera */
.navbar-brand img {
  height: 100px;
  width: auto;
  transition: all 0.3s ease;
}


@media (max-width: 768px) {
  .legal-content {
    padding: 2rem 1.5rem;
  }
  
  .legal-title {
    font-size: 2rem;
  }
  
  .legal-subtitle {
    font-size: 1rem;
  }
}

.contact-info {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.contact-info a {
  color: var(--secondary-color);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.map-container {
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.google-map iframe {
  width: 100%;
  height: 300px;
  border: none;
}

.stats-section {
  background: var(--secondary-color);
  color: var(--white);
  padding: 4rem 0;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1.1rem;
  opacity: 0.9;
}

@media (max-width: 768px) {
  body {
    padding-top: 11px; /* Mitad del tamaño actual (22px * 0.5) */
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.2rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .navbar-brand img {
    height: 30px; /* Tamaño visible en móviles */
  }
  
  /* Logo reducido en móviles cuando está scrolled */
  .navbar.scrolled .navbar-brand img {
    height: 20px !important; /* Tamaño más visible */
  }
  
  /* Botón de volver arriba en móviles */
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }
  
  .navbar-caption {
    font-size: 0.1125rem; /* Mitad del tamaño actual (0.225rem * 0.5) */
  }
  
  .navbar {
    padding: 0.0625rem 0; /* Mitad del tamaño actual (0.125rem * 0.5) */
    min-height: 17.5px; /* Mitad del tamaño actual (35px * 0.5) */
  }
  
  .navbar-brand {
    gap: 0.125rem; /* Mitad del tamaño actual (0.25rem * 0.5) */
  }
  
  /* Ajustar scroll-margin-top para la cabecera reducida */
  #servicios,
  #nosotros,
  #contacto {
    scroll-margin-top: 18px; /* Mitad del tamaño actual (37px * 0.5) */
  }
  
  .hero-section {
    padding: 4rem 0 6rem 0; /* Menor padding en móviles */
    background-attachment: scroll; /* Mejor rendimiento en móviles */
    background-size: cover;
    background-position: center top;
  }
  
  /* Asegurar que el fondo se vea bien en móviles */
  .hero-section::before {
    background: 
      radial-gradient(circle at 30% 70%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
      radial-gradient(circle at 70% 30%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
      linear-gradient(135deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.15) 100%);
  }
}
