/* ========== VARIABLES ========== */
:root {
  /* Colores corporativos RODISA */
  --primary: #0c4288;
  --primary-dark: #083677;
  --primary-light: #1a5cb8;
  --secondary: #26a9e1;
  --secondary-dark: #1d8fca;
  --secondary-light: #4fb3e6;
  --accent: #989898;
  --accent-light: #b0b0b0;
  
  /* Colores neutros */
  --text-dark: #333333;
  --text-light: #ffffff;
  --bg-light: #f8f9fa;
  --bg-dark: #1a202c;
  --bg-dark-gradient: #0a1622;
  --gray-100: #f7f7f7;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  
  /* Tipografía */
  --font-family: 'Montserrat', system-ui, sans-serif;
  --fs-xs: clamp(0.7rem, 0.7rem + 0.1vw, 0.8rem);
  --fs-sm: clamp(0.8rem, 0.8rem + 0.1vw, 0.9rem);
  --fs-base: clamp(1rem, 0.95rem + 0.25vw, 1.15rem);
  --fs-md: clamp(1.15rem, 1.15rem + 0.25vw, 1.3rem);
  --fs-lg: clamp(1.35rem, 1.25rem + 0.5vw, 1.7rem);
  --fs-xl: clamp(1.8rem, 1.6rem + 1vw, 2.5rem);
  --fs-2xl: clamp(2.2rem, 2rem + 1.5vw, 3.5rem);
  --fs-3xl: clamp(2.8rem, 2.5rem + 2vw, 4.5rem);
  
  /* Espaciado */
  --space-3xs: clamp(0.25rem, 0.25rem + 0vw, 0.25rem);
  --space-2xs: clamp(0.5rem, 0.5rem + 0vw, 0.5rem);
  --space-xs: clamp(0.75rem, 0.75rem + 0vw, 0.75rem);
  --space-sm: clamp(1rem, 0.95rem + 0.25vw, 1.25rem);
  --space-md: clamp(1.5rem, 1.4rem + 0.5vw, 2rem);
  --space-lg: clamp(2.5rem, 2.25rem + 1.25vw, 3.5rem);
  --space-xl: clamp(3.5rem, 3.25rem + 1.25vw, 4.5rem);
  
  /* Radios y Sombras */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Transiciones */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Z-index */
  --z-behind: -1;
  --z-base: 0;
  --z-content: 2;
  --z-above: 10;
  --z-header: 100;
  --z-modal: 1000;
  --z-loader: 9999;
}

/* ========== RESET & BASE STYLES ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--secondary) var(--bg-light);
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
  overflow-x: hidden;
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  opacity: 1;
}

body.page-loaded {
  opacity: 1;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--secondary);
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
  background-color: var(--secondary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary);
}

/* ========== PARTICLES ========== */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1 !important; /* Forzar z-index negativo */
  pointer-events: none;
}

/* ========== ANIMATIONS ========== */
keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: var(--shadow-md);
  }
  50% {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
  }
  100% {
    transform: scale(1);
    box-shadow: var(--shadow-md);
  }
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========== LAYOUT & CONTAINERS ========== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
  position: relative;
  z-index: var(--z-content);
}

.section {
  padding: var(--space-lg) 0;
  position: relative;
  z-index: var(--z-base);
  overflow: hidden;
  background-color: rgba(248, 249, 250, 0.9); /* Fondo semi-transparente */
}

.section::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: var(--z-behind);
}

.section-light {
  background-color: rgba(248, 249, 250, 0.9);
  position: relative;
  z-index: var(--z-base);
}

.section-light::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(248, 249, 250, 0.8);
  z-index: var(--z-behind);
}

.section-dark {
  background-color: rgba(26, 32, 44, 0.95);
  color: var(--text-light);
}

.section-pattern {
  position: relative;
}

.section-pattern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(12, 66, 136, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(38, 169, 225, 0.05) 0%, transparent 50%);
  background-size: 60% 60%, 40% 40%;
  background-position: 0 0;
  background-repeat: no-repeat;
  z-index: var(--z-behind);
}

/* ========== HEADER & NAVIGATION ========== */

/* Estilos principales del encabezado */
#masthead {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(12, 66, 136, 0.7); /* Semitransparente pero visible */
  backdrop-filter: blur(5px); /* Desenfoque para mejorar legibilidad */
  box-shadow: var(--shadow-sm); /* Sombra sutil */
  z-index: var(--z-header);
  transition: all var(--transition);
  padding: 1.5rem 0; /* Un poco más alto inicialmente */
}

/* Estilo cuando se hace scroll */
#masthead.scrolled {
  padding: 0.6rem 0;
  background-color: rgba(12, 66, 136, 0.95); /* Más opaco al hacer scroll */
  backdrop-filter: blur(10px); /* Mayor desenfoque */
  box-shadow: var(--shadow-md); /* Sombra más pronunciada */
}

/* Contenedor del header */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Estilos del logo */
.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 60px;
  transition: height var(--transition);
  filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3)); /* Sombra sutil al logo */
}

#masthead.scrolled .logo img {
  height: 50px;
}

/* Botón de menú para móviles */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: var(--fs-lg);
  cursor: pointer;
  padding: 0.5rem;
  transition: color var(--transition);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.menu-toggle:hover {
  color: var(--secondary);
}

/* Navegación principal */
#main-nav ul {
  display: flex;
  gap: 1.5rem;
}

#main-nav a {
  color: var(--text-light);
  font-weight: 700; /* Más negrita para mejor contraste */
  font-size: var(--fs-sm);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); /* Sombra de texto para legibilidad */
  position: relative;
  padding: 0.5rem 0.75rem; /* Padding para área de clic más grande */
  border-radius: var(--radius-sm); /* Bordes redondeados */
  transition: all var(--transition);
  background-color: transparent;
}

#main-nav a:hover {
  color: var(--secondary-light);
  background-color: rgba(0, 0, 0, 0.2); /* Fondo oscuro al hover */
}

#main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background-color: var(--secondary);
  transition: transform var(--transition), opacity var(--transition);
  transform: scaleX(0);
  opacity: 0;
}

#main-nav a:hover::after {
  transform: scaleX(1);
  opacity: 1;
}

/* Menú desplegable (si es necesario) */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dropdown-toggle::after {
  content: '▼';
  font-size: 0.6em;
  margin-top: 0.2em;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background-color: rgba(12, 66, 136, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
  z-index: var(--z-above);
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background-color: rgba(38, 169, 225, 0.2);
}

/* Menú actual / página activa */
#main-nav a.active {
  color: var(--secondary-light);
  background-color: rgba(0, 0, 0, 0.1);
}

#main-nav a.active::after {
  transform: scaleX(1);
  opacity: 1;
}

/* Estilos responsive para el menú */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  #main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: rgba(12, 66, 136, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
  }
  
  #main-nav.active {
    max-height: 350px;
    visibility: visible;
    overflow-y: auto;
  }
  
  #main-nav ul {
    flex-direction: column;
    padding: var(--space-sm);
    gap: var(--space-xs);
  }
  
  #main-nav a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
  }
  
  #main-nav a:hover {
    background-color: rgba(38, 169, 225, 0.2);
  }
  
  #main-nav a::after {
    display: none;
  }
  
  /* Manejo de dropdown en móvil */
  .dropdown-menu {
    position: static;
    background-color: rgba(0, 0, 0, 0.1);
    min-width: auto;
    box-shadow: none;
    padding: 0;
    visibility: visible;
    opacity: 1;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .dropdown.active .dropdown-menu {
    max-height: 350px;
  }
  
  .dropdown-toggle {
    justify-content: space-between;
  }
}

/* Estilos para cuando JavaScript está deshabilitado */
.no-js #main-nav {
  position: static;
  max-height: none;
  visibility: visible;
}

.no-js .menu-toggle {
  display: none;
}


/* ========== HERO SECTION ========== */
.hero {
  position: relative;
  height: 85vh;
  min-height: 560px;
  display: flex;
  align-items: center;
  color: var(--text-light);
  margin-top: 80px;
  overflow: hidden;
  z-index: var(--z-base);
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: var(--z-behind);
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(12, 66, 136, 0.75), rgba(38, 169, 225, 0.4));
  z-index: var(--z-behind);
}

.hero-content {
  position: relative;
  z-index: var(--z-content);
  max-width: 600px;
  animation: fadeIn 1.5s ease-out;
}

.hero h1 {
  font-size: var(--fs-3xl);
  color: var(--text-light);
  margin-bottom: 0;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero h2 {
  font-size: var(--fs-2xl);
  color: var(--secondary-light);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: var(--fs-md);
  margin-bottom: var(--space-md);
  max-width: 90%;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  opacity: 0.95;
}

.hero-buttons {
  display: flex;
  gap: var(--space-sm);
}

.hero-scroll-down {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
  animation: bounce 2s infinite;
  z-index: var(--z-content);
}

/* ========== BUTTONS & CONTROLS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.75em 1.5em;
  background-color: var(--primary);
  color: var(--text-light);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: 
    transform var(--transition), 
    background-color var(--transition),
    box-shadow var(--transition);
  position: relative;
  overflow: hidden;
  z-index: var(--z-content);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--text-light);
}

.btn:active {
  transform: translateY(0);
}

.btn::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: -100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.7s ease;
  z-index: -1;
}

.btn:hover::after {
  left: 100%;
}

.btn-primary {
  background-color: var(--primary);
}

.btn-secondary {
  background-color: var(--secondary);
}

.btn-secondary:hover {
  background-color: var(--secondary-dark);
}

.btn-sm {
  padding: 0.5em 1em;
  font-size: var(--fs-xs);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: var(--text-light);
}

.btn-block {
  width: 100%;
}

/* ========== SECTION TITLE ========== */
.section-title {
  text-align: center;
  margin-bottom: var(--space-md);
  position: relative;
  z-index: var(--z-content);
}

.section-title h2 {
  font-size: var(--fs-xl);
  color: var(--primary);
  position: relative;
  display: inline-block;
  padding-bottom: var(--space-xs);
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: var(--secondary);
}

.section-subtitle {
  max-width: 700px;
  margin: 0 auto;
  color: var(--gray-700);
}

/* ========== ABOUT SECTION ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  align-items: center;
}

.about-content h2 {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-xs);
}

.about-content p {
  font-size: var(--fs-base);
  margin-bottom: var(--space-xs);
}

.about-grid img {
  max-width: 300px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition);
}

.about-grid img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

/* ========== FLIP CARDS ========== */
.flip-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.flip-card {
  background-color: transparent;
  height: 220px;
  perspective: 1000px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card:focus-within .flip-card-inner {
  transform: rotateY(180deg);
}

/* Estilos adicionales para las flip-cards con imágenes */
.flip-card-front {
  position: relative;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
}

.flip-card-front > div {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: rgba(12, 66, 136, 0.7);
  transition: background-color 0.3s ease;
}

.flip-card:hover .flip-card-front > div {
  background-color: rgba(12, 66, 136, 0.85);
}

.flip-card-front h3, 
.flip-card-front .flip-card-description {
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.flip-card-front, 
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.flip-card-front {
  background-color: var(--primary);
  color: var(--text-light);
}

.flip-card-front h3 {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-xs);
  color: var(--text-light);
}

.flip-card-description {
  font-size: var(--fs-base);
  opacity: 0.95;
}

.flip-card-back {
  background-color: var(--secondary);
  color: var(--text-light);
  transform: rotateY(180deg);
}

.flip-card-back p {
  font-size: var(--fs-sm);
  line-height: 1.7;
  margin-bottom: var(--space-sm);
}

/* ========== CARDS ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-sm);
}

.card {
  background-color: var(--text-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.card-img-container {
  position: relative;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card-img {
  transform: scale(1.05);
}

.card-img-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover .card-img-overlay {
  opacity: 1;
}

.card-content {
  padding: var(--space-sm);
  text-align: center;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: var(--fs-md);
  margin-bottom: var(--space-xs);
  color: var(--primary);
}

.card-description {
  font-size: var(--fs-sm);
  margin-bottom: var(--space-sm);
}

.card-footer {
  margin-top: auto;
}

/* ========== SERVICE CARDS ========== */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.service-card {
  background-color: var(--text-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.service-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: var(--text-light);
  border-radius: 50%;
  font-size: var(--fs-lg);
  z-index: 2;
  box-shadow: var(--shadow-md);
}

.service-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.service-card:hover .service-img {
  transform: scale(1.05);
}

.service-content {
  padding: var(--space-sm);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.service-title {
  font-size: var(--fs-md);
  color: var(--primary);
  margin-bottom: var(--space-xs);
}

.service-description {
  font-size: var(--fs-sm);
  margin-bottom: var(--space-sm);
}

.service-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

/* ========== GALLERY ========== */
.gallery {
  position: relative;
  margin: 0 auto;
  max-width: 90%;
  height: 400px; /* Altura fija para la galería */
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background-color: #fff; /* Fondo blanco para evitar transparencia */
}

.gallery-container {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease;
}

.gallery-item {
  min-width: 100%;
  height: 100%;
  position: relative;
  flex-shrink: 0;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: var(--space-sm);
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: var(--text-light);
  z-index: 2;
}

.gallery-caption h3 {
  font-size: var(--fs-md);
  color: var(--text-light);
  margin-bottom: var(--space-3xs);
}

.gallery-caption p {
  font-size: var(--fs-sm);
  margin-bottom: 0;
  opacity: 0.9;
}

.gallery-prev, 
.gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background-color: rgba(12, 66, 136, 0.8);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s, transform 0.3s;
}

.gallery-prev:hover,
.gallery-next:hover {
  background-color: var(--secondary);
  transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
  left: 20px;
}

.gallery-next {
  right: 20px;
}

.gallery-pagination {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 5;
}

.gallery-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border: none;
  transition: background-color 0.3s, transform 0.3s;
}

.gallery-dot.active {
  background-color: var(--secondary);
  transform: scale(1.2);
}

/* Estilo para texto cuando no hay imágenes */
.gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray-600);
  padding: 2rem;
  text-align: center;
  background-color: white;
}

.gallery-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--secondary);
}

/* ========== PARTNERS ========== */
.partners-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin: 0 auto;
}

.partner-logo {
  max-width: 180px;
  height: 80px;
  object-fit: contain;
  filter: grayscale(80%);
  opacity: 0.7;
  transition: filter var(--transition), opacity var(--transition), transform var(--transition);
}

.partner-logo:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.05);
}

/* ========== CONTACT ========== */
.contact {
  background-color: var(--primary);
  color: var(--text-light);
  padding: var(--space-lg) 0;
  position: relative;
  overflow: hidden;
  z-index: var(--z-base);
}

.contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><rect fill="none" width="20" height="20"/><rect fill="rgba(255,255,255,0.03)" x="5" y="5" width="10" height="10" transform="rotate(45 10 10)"/></svg>');
  opacity: 0.5;
  z-index: var(--z-behind);
}

.contact .section-title h2 {
  color: var(--text-light);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.contact-form-container {
  background-color: rgba(255, 255, 255, 0.1);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-group {
  margin-bottom: var(--space-xs);
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-light);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition), border-color var(--transition);
}

.form-control:focus {
  outline: none;
  background-color: rgba(255, 255, 255, 0.2);
  border-color: var(--secondary);
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.form-control.error {
  border-color: #e74c3c;
}

.form-success {
  text-align: center;
  padding: var(--space-md);
}

.form-success i {
  font-size: 3rem;
  color: var(--secondary-light);
  margin-bottom: var(--space-sm);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.contact-icon {
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  color: var(--secondary-light);
  flex-shrink: 0;
}

.contact-info-item h3 {
  color: var(--text-light);
  margin-bottom: var(--space-2xs);
  font-size: var(--fs-md);
}

.contact-info-item p {
  margin-bottom: 0;
  opacity: 0.9;
}

.contact-info-item a {
  color: var(--secondary-light);
  transition: color var(--transition);
}

.contact-info-item a:hover {
  color: var(--text-light);
  text-decoration: underline;
}

.social-links {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.social-links a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  color: var(--text-light);
  font-size: var(--fs-md);
  transition: 
    transform var(--transition),
    background-color var(--transition);
}

.social-links a:hover {
  background-color: var(--secondary);
  transform: translateY(-5px);
}

/* ========== FOOTER ========== */
.rodisa-footer {
  background-color: var(--bg-dark);
  color: var(--text-light);
  position: relative;
  background: linear-gradient(to bottom, var(--bg-dark), var(--bg-dark-gradient));
  z-index: var(--z-base);
}

.rodisa-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  opacity: 0.8;
  z-index: var(--z-above);
}

.footer-main {
  padding: var(--space-md) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-main .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo img {
  max-width: 150px;
}

.social-icons {
  display: flex;
  gap: var(--space-xs);
}

.social-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  color: var(--text-light);
  font-size: var(--fs-sm);
  transition: 
    background-color var(--transition),
    transform var(--transition);
}

.social-icon:hover {
  background-color: var(--secondary);
  transform: translateY(-3px);
}

.footer-info {
  padding: var(--space-sm) 0;
  position: relative;
  z-index: var(--z-content);
}

.footer-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
}

.footer-info-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  transition: transform var(--transition);
}

.footer-info-item:hover {
  transform: translateY(-5px);
}

.footer-icon {
  font-size: var(--fs-lg);
  color: var(--secondary);
  margin-top: 3px;
  transition: transform var(--transition), color var(--transition);
}

.footer-info-item:hover .footer-icon {
  transform: scale(1.2);
  color: var(--secondary-light);
}

.footer-text {
  font-size: var(--fs-sm);
  opacity: 0.9;
}

.footer-text a {
  color: var(--secondary-light);
  transition: color var(--transition), text-decoration var(--transition);
}

.footer-text a:hover {
  color: var(--text-light);
  text-decoration: underline;
}

.footer-bottom {
  background-color: rgba(0, 0, 0, 0.2);
  padding: var(--space-sm) 0;
  text-align: center;
  font-size: var(--fs-sm);
}

.footer-bottom p {
  margin-bottom: var(--space-xs);
  opacity: 0.8;
}

.footer-bottom a {
  color: var(--secondary-light);
}

.footer-bottom .fa-heart {
  color: #e74c3c;
  margin: 0 3px;
}

/* ========== SCROLL TRIGGER ANIMATIONS ========== */
.scroll-trigger {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-trigger.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== BACK TO TOP BUTTON ========== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary);
  color: var(--text-light);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
  z-index: 80;
  box-shadow: var(--shadow-md);
  border: none;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--secondary);
  transform: translateY(-5px);
}

/* ========== LOADER ========== */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--z-loader);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  position: relative;
}

.loader-spinner:before,
.loader-spinner:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--text-light);
}

.loader-spinner:before {
  z-index: 10;
  animation: spin 1s infinite linear;
}

.loader-spinner:after {
  border: 4px solid rgba(255, 255, 255, 0.3);
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.loader-logo {
  opacity: 0;
  animation: fadeIn 0.5s ease-out 0.3s forwards;
}

/* ========== UTILITY CLASSES ========== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-end { justify-content: flex-end; }

.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-2xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-2xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }

.mx-auto { margin-left: auto; margin-right: auto; }

.py-1 { padding-top: var(--space-2xs); padding-bottom: var(--space-2xs); }
.py-2 { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-3 { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-4 { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }

.px-1 { padding-left: var(--space-2xs); padding-right: var(--space-2xs); }
.px-2 { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-3 { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-4 { padding-left: var(--space-lg); padding-right: var(--space-lg); }

.overflow-hidden { overflow: hidden; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-light { background-color: var(--bg-light); }
.bg-dark { background-color: var(--bg-dark); }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-light { color: var(--text-light); }
.text-dark { color: var(--text-dark); }
.text-gray { color: var(--gray-600); }

.fw-normal { font-weight: 400; }
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }

.fs-xs { font-size: var(--fs-xs); }
.fs-sm { font-size: var(--fs-sm); }
.fs-base { font-size: var(--fs-base); }
.fs-md { font-size: var(--fs-md); }
.fs-lg { font-size: var(--fs-lg); }
.fs-xl { font-size: var(--fs-xl); }
.fs-2xl { font-size: var(--fs-2xl); }
.fs-3xl { font-size: var(--fs-3xl); }

/* ========== RESPONSIVE STYLES ========== */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }
}

@media (max-width: 992px) {
  .container {
    max-width: 720px;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .about-grid img {
    margin: var(--space-md) auto 0;
  }
  
  .flip-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .footer-main .container {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }
  
  .social-icons {
    justify-content: center;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

@media (max-width: 768px) {
  :root {
    --fs-3xl: clamp(2.4rem, 2.1rem + 1.5vw, 3.5rem);
    --fs-2xl: clamp(1.8rem, 1.6rem + 1vw, 2.5rem);
  }
  
  .container {
    max-width: 540px;
  }
  
  .menu-toggle {
    display: block;
  }
  
  #main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-dark);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
  }
  
  #main-nav.active {
    max-height: 300px;
    visibility: visible;
  }
  
  #main-nav ul {
    flex-direction: column;
    padding: var(--space-sm);
    gap: var(--space-xs);
  }
  
  #main-nav a {
    display: block;
    padding: var(--space-xs) 0;
  }
  
  .hero {
    height: 70vh;
  }
  
  .hero-buttons {
    flex-direction: column;
    width: 100%;
    gap: var(--space-xs);
  }
  
  .card-grid,
  .service-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  
  .gallery {
    max-width: 100%;
    height: 300px;
  }
  
  .section-title h2::after {
    width: 60px;
  }
  
  .footer-info-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  
  .footer-info-item {
    align-items: center;
    text-align: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-2xs);
  }
  
  .footer-icon {
    margin-top: 0;
    margin-bottom: var(--space-3xs);
  }
  
  .back-to-top {
    right: var(--space-xs);
    bottom: var(--space-xs);
  }
}

@media (max-width: 576px) {
  .container {
    width: 100%;
    padding: 0 var(--space-xs);
  }
  
  .hero {
    height: 65vh;
    min-height: 500px;
  }
  
  .hero h1 {
    font-size: var(--fs-2xl);
  }
  
  .hero h2 {
    font-size: var(--fs-xl);
  }
  
  .section {
    padding: var(--space-md) 0;
  }
  
  .section-title {
    margin-bottom: var(--space-sm);
  }
  
  .section-title h2 {
    font-size: var(--fs-lg);
  }
  
  .flip-card-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-prev, 
  .gallery-next {
    width: 40px;
    height: 40px;
    font-size: var(--fs-sm);
  }
  
  .gallery {
    height: 220px;
  }
  
  .partners-grid {
    gap: var(--space-sm);
  }
  
  .partner-logo {
    max-width: 130px;
    height: 60px;
  }
  
  .contact-logo img {
    max-width: 160px;
  }
  
  .footer-logo img {
    max-width: 130px;
  }
  
  .social-links a {
    width: 40px;
    height: 40px;
  }
}

/* ========== DARK MODE SUPPORT ========== */
@media (prefers-color-scheme: dark) {
  :root {
    --text-dark: #e2e8f0;
    --text-light: #f8f9fa;
    --bg-light: #2d3748;
    --gray-200: #4a5568;
    --gray-300: #718096;
    
    /* Versiones más brillantes para modo oscuro */
    --primary: #1a5cb8;
    --primary-dark: #0c4288;
    --primary-light: #3a7cd8;
    --secondary: #4fb3e6;
    --secondary-dark: #26a9e1;
    --secondary-light: #6fc4f0;
  }
  
  .section-light::before {
    background-color: rgba(45, 55, 72, 0.8);
  }
  
  .card, .service-card {
    background-color: #2d3748;
    box-shadow: var(--shadow-lg);
  }
  
  .gallery-empty {
    background-color: #2d3748;
    color: #e2e8f0;
  }
  
  .form-control {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .form-control:focus {
    background-color: rgba(255, 255, 255, 0.1);
  }
}

/* ========== REDUCED MOTION SUPPORT ========== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .scroll-trigger {
    opacity: 1;
    transform: none;
    transition: none;
  }
  
  .btn::after {
    display: none;
  }
}

/* ========== FINAL FIXES AND ADJUSTMENTS ========== */
/* Asegurar que las partículas estén siempre por debajo del contenido */
#particles-js {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: -1 !important;
  pointer-events: none !important;
}

/* Garantizar fondos sólidos para todas las secciones */
.section,
.section-light,
.section-dark,
.contact,
.rodisa-footer {
  position: relative;
  z-index: 1;
}

/* Asegurar que el contenido esté por encima de las partículas */
.container,
.section-title,
.card,
.service-card,
.flip-card,
.gallery,
.hero-content,
.social-links,
.footer-info-item {
  position: relative;
  z-index: 2;
}

/* Overlay para galería */
.gallery::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.01);
  z-index: 1;
  pointer-events: none;
}