:root {
  /* Colores principales */
  --primary-color: #2ea3a3;
  --primary-dark: #1f7a7a;
  --secondary-color: #f8f9fa;
  --text-dark: #333;
  --text-light: #fff;
  --background-dark: #1a1a1a;
  
  /* Espaciados */
  --section-padding: 5rem 1rem;
  --container-width: 1200px;
  
  /* Transiciones */
  --transition-speed: 0.3s;
}

/* Modo Oscuro */
@media (prefers-color-scheme: dark) {
  :root {
    --text-dark: #f8f9fa;
    --background-dark: #ffffff;
  }
}

/* Reset y estilos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  overflow-x: hidden;
}

/* Tipografía */
h1, h2, h3 {
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.8rem; }

p {
  margin-bottom: 1.5rem;
  color: #666;
}

/* Enlaces y botones */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 5px;
  font-weight: bold;
  transition: all var(--transition-speed) ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary-dark);
  color: var(--text-light);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  border-color: var(--text-light);
  color: var(--text-light);
}

/* Header */
.header {
  background: linear-gradient(rgba(0,0,0,0.7), url('img/Fondo1.png') center/cover);
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-light);
  position: relative;
}

.hero-content {
  max-width: var(--container-width);
  padding: 2rem;
  position: relative;
  z-index: 2;
}

.hero-content img {
  width: 150px;
  margin-bottom: 2rem;
  animation: fadeIn 1s ease-out;
}

/* Sección Servicios */
.services {
  padding: var(--section-padding);
  background: var(--secondary-color);
}

.services-header {
  text-align: center;
  margin-bottom: 3rem;
}
.services-header .section-title {
  font-size: 2.5rem;
  color: var(--text-dark);
  margin: 0;
}
.services-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: var(--container-width);
  margin: 0 auto;
}

.service-card {
  background: transparent;
  position: relative;
  overflow: hidden;
  min-height: 460px;
  isolation: isolate;
  padding: 2rem;
  border-radius: 15px;
  transition: transform var(--transition-speed) ease;
}

.service-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  filter: blur(2px) brightness(0.7);
  transform: scale(1.02);
  z-index: -1;
  transition: transform 0.5s ease, filter 0.3s ease;
}

.service-card:hover .service-bg {
  transform: scale(1);
  filter: blur(0) brightness(0.8);
}

.service-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.service-content {
  position: relative;
  z-index: 2;
  color: #fff;
  text-align: center;
}

.service-content h3 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.service-content p {
  font-size: 1rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.8rem;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 1.5rem;
}

.btn-link {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border-radius: 5px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-link:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  color: #fff;
}

/* Nuevas categorías específicas */
.service-card:nth-child(2) .service-icon {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.service-card:nth-child(3) .service-icon {
  width: 100px;
  height: 100px;
}

/* Sección Sobre Nosotros */
/* Sección Expertos en Implementación BIM */
.about {
  position: relative;
  background: url('img/about-bg.jpg') center/cover fixed;
  color: #fff;
  padding: 4rem 1rem;
}
.about-overlay {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1;
}

.container {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  justify-content: center; 
  min-height: 100vh; 
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.about-lead {
  font-size: 1.25rem;
  line-height: 1.6;
  max-width: 40ch;
  margin: 0 auto;
}

.about-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

.about-item {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  text-align: center;
  vertical-align: auto;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.check-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  fill: var(--primary-color);
}

.about-item span {
  font-size: 1rem;
  line-height: 1.4;
}

/* Responsive */
@media (max-width: 480px) {
  .section-title {
    font-size: 2rem;
  }
  .about-lead {
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  .about-item {
    flex-direction: column;
    text-align: center;
  }
}

/* Formulario de Contacto */
.loader {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.contact {
  padding: var(--section-padding);
  background: var(--primary-color);
  color: var(--text-light);
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

input, textarea {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  transition: box-shadow var(--transition-speed) ease;
}

input:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 163, 163, 0.3);
}

.btn-text {
  display: inline-block;
  transition: transform 0.3s ease;
}

.send-icon {
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  display: inline-block;
}

.contact-btn {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.75rem 2rem;
  background: var(--primary-color);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.5rem;
}

#contact .btn-primary:hover .btn-text {
  transform: translateX(-5px);
}

#contact .btn-primary:hover .send-icon {
  opacity: 1;
  transform: translateX(5px);
}

.contact-btn:hover {
  background: var(--primary-color-hover);
  transform: translateY(-2px);
}
/* Footer */
.footer {
  background: var(--background-dark);
  color: var(--text-light);
  padding: 3rem 1rem;
  text-align: center;
}

.social-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin: 2rem 0;
}

.social-links a {
  opacity: 0.8;
  transition: opacity var(--transition-speed) ease;
}

.social-links a:hover {
  opacity: 1;
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    margin: 0 1rem;
  }
}

@media (max-width: 480px) {
  .cta-container {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    text-align: center;
  }
}

/* Utilidades */
.text-center {
  text-align: center;
}

.section-title {
  margin-bottom: 3rem;
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Estilos para la nueva sección expandible general */
.service-expanded-detail {
  background-color: var(--secondary-color); /* Fondo claro para contrastar con servicios */
  color: var(--text-dark);
  padding: 0 1rem; /* Padding horizontal inicial */
  max-height: 0; /* Inicialmente oculto */
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.7s ease-in-out, opacity 0.7s ease-in-out, padding 0.7s ease-in-out;
  box-shadow: 0 -5px 15px rgba(0,0,0,0.05); /* Sombra sutil arriba */
  position: relative; /* Para el botón de cerrar */
}

.service-expanded-detail.show {
  max-height: 2000px; /* Suficientemente grande para el contenido */
  opacity: 1;
  padding: 3rem 1rem; /* Padding cuando está visible */
}

.expanded-content-wrapper {
  max-width: 1000px; /* Increased max-width for more content */
  margin: 0 auto;
  padding: 2.5rem; /* Adjusted padding */
  border-radius: 10px;
  background-color: #fff; /* Fondo blanco para el contenido dentro */
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  position: relative;
}

.expanded-content-wrapper h2 {
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  font-size: 2rem;
  text-align: center;
}

.expanded-content-wrapper h3 {
  color: var(--primary-color);
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  font-size: 1.4rem;
}

.expanded-content-wrapper p, .expanded-content-wrapper ul {
  color: #555;
  margin-bottom: 1rem;
  font-size: 1.05rem; /* Slightly increased font size for readability */
}

.expanded-content-wrapper ul {
  list-style-type: disc;
  margin-left: 20px;
  margin-bottom: 1.5rem;
}

.expanded-content-wrapper ul li {
  margin-bottom: 0.5rem;
}

.close-expanded-detail-button {
  color: #aaa;
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-expanded-detail-button:hover,
.close-expanded-detail-button:focus {
  color: #333;
  text-decoration: none;
}

.expanded-detail-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
  flex-wrap: wrap; /* Para responsividad en botones */
}

.expanded-detail-actions .btn {
  padding: 0.8rem 1.8rem;
  font-size: 1rem;
  border-radius: 8px;
}

/* Estilos para el collage de imágenes */
.image-collage-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Columnas responsivas */
  gap: 15px; /* Espacio entre imágenes */
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.collage-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease-in-out;
}

.collage-image:hover {
  transform: scale(1.03);
}

/* Styles for the new Add-in Ribbon Panel */
.automation-ribbon-panel {
  background-color: var(--secondary-color); /* Fondo para el panel de la cinta */
  padding: 0 1rem; /* Padding horizontal inicial */
  max-height: 0; /* Inicialmente oculto */
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.7s ease-in-out, opacity 0.7s ease-in-out, padding 0.7s ease-in-out;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05); /* Sombra sutil abajo */
  position: relative;
  display: flex; /* Para centrar la cinta */
  justify-content: center; /* Centrar la cinta */
  align-items: center; /* Centrar verticalmente */
  flex-direction: column; /* Para que el título y la cinta estén en columna */
}

.automation-ribbon-panel.show {
  max-height: 800px; /* Increased max-height for more content */
  opacity: 1;
  padding: 3rem 1rem; /* Increased padding-top to give more space for hover animation */
}

.automation-ribbon-panel h3 {
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  text-align: start;
}

.add-in-ribbon {
  display: flex;
  overflow-x: auto; /* Enable horizontal scrolling */
  gap: 2.5rem; /* Increased space between add-in covers */
  padding-bottom: 10px; /* Space for scrollbar */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--primary-color) #f1f1f1; /* Firefox */
  max-width: 100%; /* Asegura que no se desborde */
  flex-wrap: wrap; /* Allow items to wrap to the next line */
  justify-content: center; /* Center items when they wrap */
  padding: 20px;
}

/* Custom scrollbar for Webkit browsers */
.add-in-ribbon::-webkit-scrollbar {
  height: 8px;
}

.add-in-ribbon::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.add-in-ribbon::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

.add-in-ribbon::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

.add-in-cover {
  flex-shrink: 0; /* Prevent items from shrinking */
  width: 250px; /* Further increased width for each cover */
  height: 290px; /* Increased height to give more space for text and prevent clipping */
  background: rgba(255, 255, 255, 0.15); /* Slightly transparent background */
  backdrop-filter: blur(5px);
  border-radius: 10px;
  padding: 1.5rem; /* Increased padding */
  padding-top: 2rem; /* Added more padding to the top to prevent clipping on hover */
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative; /* Para posicionar la etiqueta de "GRATIS" */
}

.add-in-cover:hover {
  transform: translateY(-10px); /* Increased translateY for more pronounced effect */
  background: rgba(255, 255, 255, 0.25);
}

.add-in-cover img {
  width: 140px; /* Increased size for add-in icon */
  height: 140px;
  object-fit: contain;
  margin-bottom: 1rem; /* Increased margin */
  border-radius: 5px; /* Slightly rounded images */
}

.add-in-cover h4 {
  color: var(--text-light); /* Text color for add-in title */
  font-size: 1.4rem; /* Further increased font size */
  margin: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* New style for the "Free" label */
.free-label {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--primary-dark);
  color: var(--text-light);
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}


/* Adjustments for service-content in automation card */
.service-card .service-content p {
  background: none; /* Remove background from the general description */
  color: #fff;
  padding: 0;
  margin-bottom: 1.5rem;
}

/* Estilos para el reproductor de video */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  background: #000;
  margin-top: 2rem;
  margin-bottom: 2rem;
  border-radius: 10px;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}


/* Responsive para el modal (ahora para la sección expandida) */
@media (max-width: 768px) {
  .expanded-content-wrapper {
    padding: 20px;
    width: 95%;
  }

  .expanded-content-wrapper h2 {
    font-size: 1.8rem;
  }

  .expanded-detail-actions {
    flex-direction: column;
    align-items: center;
  }

  .expanded-detail-actions .btn {
    width: 100%;
  }

  .image-collage-container {
    grid-template-columns: 1fr; /* Una columna en pantallas pequeñas */
  }

  .add-in-cover {
    width: 180px; /* Adjusted width for mobile */
    height: 240px; /* Adjusted height for mobile */
    padding: 1rem;
    padding-top: 1.5rem; /* Adjusted padding-top for mobile */
  }

  .add-in-cover img {
    width: 90px;
    height: 90px;
  }

  .add-in-cover h4 {
    font-size: 1.1rem;
  }

  .add-in-ribbon {
    gap: 1.5rem; /* Adjusted gap for mobile */
  }
}
