/* ========================================= */
/* 1. CONFIGURACIÓN GLOBAL Y TIPOGRAFÍA BASE
/* ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

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

html {
  font-size: 100%;
}

body {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  background-color: #f4f4f4;
  color: #333;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'liga' 1, 'kern' 1;
}

/* ========================================= */
/* 2. JERARQUÍA DE TEXTO Y ESTILOS
/* ========================================= */
h1, h2, h3, h4 {
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1.25rem;
  max-width: 75ch; /* Límite de ancho de línea */
}

a {
  color: #007bff;
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

a:hover {
  color: #0056b3;
  border-bottom: 1px solid #0056b3;
}

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* ========================================= */
/* 3. LAYOUT (HEADER, NAV, FOOTER)
/* ========================================= */
header {
  background-color: #f0f8ff; /* Azul pálido (AliceBlue) */
  color: #333;
  padding: 15px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap; 
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  width: 60px;  /* Logo 150% */
  height: 60px; /* Logo 150% */
  margin-right: 15px;
}

.logo h1 {
  font-size: 1.8rem;
  margin: 0;
}

nav a {
  color: #333;
  padding: 10px 15px;
  margin: 0 5px;
  font-weight: 700;
  border-radius: 4px;
  border-bottom: none;
}

nav a:hover,
nav a.active {
  background-color: #007bff;
  color: #fff;
  border-bottom: none;
}

footer {
  background-color: #333;
  color: #ccc;
  text-align: center;
  padding: 30px 20px 20px;
  margin-top: 40px;
}

footer a {
  color: #ffffff;
  border-bottom: none;
}

footer a:hover {
  color: #ffffff;
  text-decoration: underline;
  border-bottom: none;
}

/* ========================================= */
/* 4. PÁGINA INDEX (SPLIT SCREEN)
/* ========================================= */
.split-container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  overflow: hidden; 
}

.split {
  width: 50%;
  height: 100%;
  position: relative;
  overflow: hidden;
  transition: width 0.8s cubic-bezier(0.77, 0, 0.175, 1),
              filter 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.split.left { background: linear-gradient(to right, #007bff, #0056b3); }
.split.right { background: linear-gradient(to right, #2c3e50, #4a688a); }

.split-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  z-index: 2;
  width: 80%;
}

.split-content h2 {
  font-size: 3rem;
  margin: 0 0 20px 0; /* Ajuste de margen */
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  letter-spacing: 0;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- NUEVO: ESTILO DESCRIPCIÓN --- */
.split-description {
  font-size: 1.1rem;
  font-weight: 300;
  color: #fff;
  margin: 20px auto;
  max-width: 400px;
  
  /* Oculto por defecto */
  opacity: 0;
  max-height: 0;
  transform: translateY(20px);
  /* Animación */
  transition: opacity 0.5s ease 0.2s, /* Delay para aparecer */
              max-height 0.5s ease 0.2s,
              transform 0.5s ease 0.2s,
              margin 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.split-button {
  display: inline-block;
  padding: 15px 30px;
  border: 2px solid #fff;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  border-bottom: 2px solid #fff;
  margin-top: 10px; /* Espacio */
}

.split-button:hover {
  background: #fff;
  color: #333;
  border-bottom: 2px solid #fff;
}

/* --- MODIFICADO: Animación de expansión --- */
.split-container.hover-left .split.left { width: 75%; }
.split-container.hover-left .split.right { width: 25%; filter: brightness(0.7); }
.split-container.hover-right .split.right { width: 75%; }
.split-container.hover-right .split.left { width: 25%; filter: brightness(0.7); }

/* --- NUEVO: Mostrar descripción al expandir --- */
.split-container.hover-left .split.left .split-description,
.split-container.hover-right .split.right .split-description {
  opacity: 1;
  max-height: 200px; /* Espacio para que crezca */
  transform: translateY(0);
}
/* Mover el título hacia arriba para dar espacio */
.split-container.hover-left .split.left h2,
.split-container.hover-right .split.right h2 {
  transform: translateY(-20px);
}

/* ========================================= */
/* 5. SECCIONES DE PÁGINA (IDA/MANT.)
/* ========================================= */
.page-section {
  max-width: 960px;
  margin: 2.5rem auto;
  padding: 2rem;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

.page-section-transparent {
  background-color: transparent;
  box-shadow: none;
  padding: 10px 20px;
}

.section-heading {
  text-align: center;
  border-bottom: 2px solid #007bff;
  padding-bottom: 10px;
  margin-bottom: 2rem;
  font-size: 2rem;
}

.section-intro-text {
  font-size: 1.2rem;
  font-weight: 300;
  color: #555;
  text-align: center;
  margin-bottom: 2rem;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

.page-section p {
  max-width: none;
}

/* ========================================= */
/* 6. SISTEMA DE TARJETAS FLIP (VERTICAL)
/* ========================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
}

.card {
  background-color: transparent;
  height: 280px; 
  perspective: 1000px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  border-radius: 8px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 8px;
  overflow: hidden;
  background-color: #ffffff;
  border: 1px solid #ddd;
}

.card-front {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.card-front h3 {
  font-size: 1.75rem;
  color: #007bff;
  letter-spacing: 0;
  margin: 0;
  text-align: center; /* Asegurar centrado */
}

/* --- MODIFICADO: Centrar texto reverso --- */
.card-back {
  transform: rotateX(180deg);
  background-color: #ffffff;
  color: #333;
  
  /* Centrado vertical y horizontal */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
}

.card-back h4 {
  font-size: 1.25rem;
  color: #007bff; 
  border-bottom: 2px solid #007bff; 
  padding-bottom: 10px;
  margin-top: 0;
  margin-bottom: 1rem;
  width: 80%; /* Para que el borde no ocupe todo */
}

.card-back p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.card-back ul {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0;
  list-style-position: inside; /* Pone bullets dentro */
  padding-left: 0; /* Quita padding de lista */
}

/* Animación Flip + Scale (Pulida) */
body:not(.no-hover) .card:hover,
.card.active {
  transform: scale(1.1); 
  z-index: 10;
  position: relative;
  box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}

body:not(.no-hover) .card:hover .card-inner,
.card.active .card-inner {
  transform: rotateX(180deg);
}

/* ========================================= */
/* 7. TARJETAS DE EJEMPLOS (NO-FLIP)
/* ========================================= */
.sector-examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.example-card {
  background-color: #ffffff;
  border: 1px solid #ddd; 
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex; /* Para centrar contenido si es necesario */
  flex-direction: column;
  justify-content: space-between;
}

.example-card:hover {
  box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
  transform: translateY(-5px);
}

.example-card h4 {
  font-size: 1.25rem;
  color: #007bff;
  margin-top: 0;
}

.example-card p {
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 0.5rem;
  max-width: none;
}

.example-card .price {
  font-weight: 700;
  font-size: 1rem;
  color: #333;
  margin-top: 15px;
}

/* ========================================= */
/* 8. FOOTER (REDES Y CONTACTO)
/* ========================================= */
.social-links {
  text-align: center;
  margin-bottom: 20px;
}

.social-links a {
  display: inline-block;
  margin: 0 15px;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-bottom: none;
}

.social-links a:hover {
  transform: scale(1.15) translateY(-2px);
  border-bottom: none;
}

.social-links img {
  width: 32px;
  height: 32px;
  filter: invert(90%) sepia(10%) saturate(100%) hue-rotate(180deg) brightness(100%) contrast(90%);
  transition: filter 0.3s ease;
}

.social-links a:hover img {
  filter: none;
}

.contact-info {
  text-align: center;
  font-size: 1rem;
}

/* --- MODIFICADO: Centrar texto footer --- */
.contact-info p {
  margin-bottom: 0.5rem;
  color: #ccc;
  max-width: none; /* Anula la regla global */
  margin-left: auto;
  margin-right: auto;
}

/* ========================================= */
/* 9. MEDIA QUERIES (RESPONSIVE)
/* ========================================= */

@media (max-width: 992px) {
  .logo h1 { font-size: 1.5rem; }
  .split-content h2 { font-size: 2.5rem; }
}

@media (max-width: 768px) {
  header {
    flex-direction: column; 
    padding: 15px 20px;
  }
  
  .logo { margin-bottom: 15px; }
  nav { width: 100%; }
  
  nav a {
    display: block; 
    text-align: center;
    margin: 5px 0;
  }
  
  .grid {
    grid-template-columns: 1fr;
    padding: 0 15px;
  }
  
  .card { height: 250px; }
  
  body:not(.no-hover) .card:hover,
  .card.active {
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
  }

  .sector-examples-grid { grid-template-columns: 1fr; }
  
  .page-section {
    margin: 20px auto;
    padding: 15px;
  }
  
  h1 { font-size: 2rem; }
  h2, .section-heading { font-size: 1.75rem; }
  h3 { font-size: 1.4rem; }
  .section-intro-text { font-size: 1.1rem; }
  
  .split-container {
    flex-direction: column;
    height: auto;
  }
  
  .split {
    width: 100% !important; 
    height: 70vh; 
    filter: none !important;
  }
  
  .split-content h2 { font-size: 2rem; }
  .split-button { padding: 12px 25px; }
  
  /* --- NUEVO: Ocultar descripción en móvil --- */
  .split-description {
    display: none;
  }
}
