/* Variables */
:root {
  --primary: #e30613;
  --primary-light: #ff4d57;
  --primary-dark: #c00510;
  --secondary: #ffffff;
  --text-dark: #333333;
  --text-light: #ffffff;
  --text-gray: #777777;
  --background: #ffffff;
  --background-alt: #f8f8f8;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  --border-radius: 12px;
}

/* Reset & Base Styles */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

body {
  font-family: "Nunito", sans-serif;
  font-size: 1.6rem;
  color: var(--text-dark);
  background-color: var(--background);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* Header & Navigation */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 19;
  transition: var(--transition);
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.main-header.scrolled {
  padding: 15px 40px;
}

.logo-container {
  z-index: 1000;
  height: 60px;
  /* padding-top: 10px; */
  position: relative;
}

/* Logo animated that moves to the center of the header */
.hero-logo {
  height: 120px;
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: fixed;
  top: 26.5%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5; /* Reducido para que esté detrás de las burbujas */
  opacity: 1;
}

.hero-logo.scrolled {
  position: fixed;
  top: 25px;
  left: 40px;
  height: 60px;
  transform: translate(0, 0);
  z-index: 1001;
  padding-bottom: 10px;
}

/* Tittle of the header that appears/disappears */
.header-title {
  opacity: 1; /* Visible desde el principio */
  transition: opacity 0.5s ease;
  font-family: "Baloo 2", cursive;
  font-size: 3rem;
  line-height: 1;
  /* padding-top: 8px; */

  .image-link {
    max-height: 80px;

    &>img {
      height: 80px;
      aspect-ratio: 2/1;
      transition: all 500ms ease;
    }
  }
}

.header-title.hidden {
  opacity: 0; /* Se oculta al hacer scroll */
}

.main-nav {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-link {
  font-size: 1.6rem;
  font-weight: 600;
  position: relative;
  padding: 5px 0;
  transition: var(--transition);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  cursor: pointer;
}

.hamburger {
  width: 24px;
  height: 18px;
  position: relative;
}

.hamburger span {
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: var(--text-dark);
  left: 0;
  transition: var(--transition);
}

.hamburger span:nth-child(1) {
  top: 0;
}

.hamburger span:nth-child(2) {
  top: 8px;
}

.hamburger span:nth-child(3) {
  top: 16px;
}

.menu-toggle.active .hamburger span:nth-child(1) {
  transform: rotate(45deg);
  top: 8px;
}

.menu-toggle.active .hamburger span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .hamburger span:nth-child(3) {
  transform: rotate(-45deg);
  top: 8px;
}

/* Main Content */
main {
  width: 100%;
  overflow-x: hidden;
}

/* Sections */
.section {
  padding: 100px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section:nth-child(even) {
  background-color: var(--background-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-title {
  font-family: "Baloo 2", cursive;
  font-size: 4.8rem;
  margin-bottom: 20px;
}

.section-header p {
  font-size: 1.8rem;
  color: var(--text-gray);
  max-width: 700px;
  margin: 0 auto;
}

.highlight {
  color: var(--primary);
  position: relative;
  display: inline-block;
}

.highlight::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 0;
  width: 100%;
  height: 8px;
  background-color: rgba(227, 6, 19, 0.2);
  z-index: -1;
  border-radius: 4px;
}

/* Hero Section */
#inicio {
  padding-top: 150px;
  position: relative;
  overflow: hidden;
  align-items: center;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  z-index: 10; /* Mayor que el logo para que las burbujas estén encima */
  padding-top: 80px; /* Espacio para el logo */
  position: relative;
}

.animated-text {
  margin-bottom: 50px;
}

.title {
  font-family: "Baloo 2", cursive;
  font-size: 4rem;
  margin-bottom: 20px;
  line-height: 1;
}

.subtitle {
  font-size: 2.4rem;
  color: var(--text-gray);
}

.text-animated {
  opacity: 0;
  transform: translateY(20px);
  display: inline-block;
  animation: fadeInUp 0.8s forwards;
}

.text-animated:nth-child(2) {
  animation-delay: 0.2s;
}

.subtitle.text-animated {
  animation-delay: 0.4s;
}

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

.app-features {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 50px;
  position: relative;
  z-index: 20; /* Aseguramos que las burbujas estén por encima del logo */
  flex-wrap: wrap;
}

.feature-bubble {
  width: 120px;
  height: 120px;
  background-color: var(--background-alt);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0;
  transform: scale(0.8);
  animation: bubbleIn 0.6s forwards;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.feature-bubble:nth-child(1) {
  animation-delay: 0.6s;
}

.feature-bubble:nth-child(2) {
  animation-delay: 0.8s;
}

.feature-bubble:nth-child(3) {
  animation-delay: 1s;
}

.feature-bubble:nth-child(4) {
  animation-delay: 1.2s;
}

@keyframes bubbleIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animated hover for the bubbles */
.feature-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1;
}

.feature-bubble:hover {
  transform: scale(1.15) translateY(-10px);
  box-shadow: 0 20px 40px rgba(227, 6, 19, 0.3);
}

.feature-bubble:hover::before {
  opacity: 1;
  transform: scale(1);
}

.feature-bubble:hover .bubble-icon svg {
  stroke: var(--text-light);
  transform: scale(1.1);
}

.feature-bubble:hover span {
  color: var(--text-light);
}

.bubble-icon {
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
  transition: var(--transition);
}

.bubble-icon svg {
  width: 30px;
  height: 30px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feature-bubble span {
  font-size: 1.4rem;
  font-weight: 600;
  position: relative;
  z-index: 2;
  transition: var(--transition);
}

.cta-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta-button {
  display: inline-block;
  padding: 15px 40px;
  background-color: var(--primary);
  color: var(--text-light);
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.8rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s forwards 1.4s;
}

.cta-button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(227, 6, 19, 0.3);
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  animation: fadeIn 1s forwards 2s;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.mouse {
  width: 30px;
  height: 50px;
  border: 2px solid var(--text-gray);
  border-radius: 20px;
  position: relative;
  margin-bottom: 10px;
}

.wheel {
  width: 6px;
  height: 6px;
  background-color: var(--text-gray);
  border-radius: 50%;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll 1.5s infinite;
}

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

.scroll-text {
  font-size: 1.4rem;
  color: var(--text-gray);
}

/* Soluciones Section */
#soluciones {
  position: relative;
}

.product-features {
  display: flex;
  flex-wrap: wrap;
  gap: 50px;
  max-width: 1200px;
  margin: 0 auto;
}

.product-showcase {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.product-showcase.visible {
  opacity: 1;
  transform: translateY(0);
}

.product-image {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: opacity 1s ease-in-out;
  width: 100%;
  max-width: 500px;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-tabs {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.tab-btn {
  padding: 10px 20px;
  background-color: var(--background-alt);
  border-radius: 30px;
  font-weight: 600;
  transition: var(--transition);
  margin-bottom: 10px;
}

.tab-btn:hover {
  background-color: rgba(227, 6, 19, 0.1);
}

.tab-btn.active {
  background-color: var(--primary);
  color: var(--text-light);
}

.feature-list {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.feature-list.visible {
  opacity: 1;
  transform: translateY(0);
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  transition: transform 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-5px);
}

.feature-icon {
  width: 60px;
  height: 60px;
  min-width: 60px;
  background-color: rgba(227, 6, 19, 0.1);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.feature-icon svg {
  width: 30px;
  height: 30px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-content h3 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.feature-content p {
  font-size: 1.6rem;
  color: var(--text-gray);
  line-height: 1.6;
}

/* Modules Section */
#modulos {
  position: relative;
}

.modules-container {
  max-width: 1200px;
  margin: 0 auto;
}

.modules-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
}

.module-card {
  height: 300px;
  width: 260px;
  position: relative;
  perspective: 1000px;
  margin-bottom: 20px;
}

.module-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card-front,
.card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: var(--border-radius);
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-front {
  background-color: var(--background-alt);
  box-shadow: var(--shadow);
  text-align: center;
}

.card-back {
  background-color: var(--primary);
  color: var(--text-light);
  transform: rotateY(180deg);
}

.module-card:hover .card-front {
  transform: rotateY(-180deg);
}

.module-card:hover .card-back {
  transform: rotateY(0);
}

.module-icon {
  width: 80px;
  height: 80px;
  background-color: rgba(227, 6, 19, 0.1);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.module-icon svg {
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-front h3 {
  font-size: 2.4rem;
  margin-bottom: 10px;
}

.card-front p {
  font-size: 1.6rem;
  color: var(--text-gray);
  margin-bottom: 20px;
}

.flip-icon {
  width: 40px;
  height: 40px;
  background-color: rgba(227, 6, 19, 0.1);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.flip-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-back .flip-icon {
  background-color: rgba(255, 255, 255, 0.2);
}

.card-back .flip-icon svg {
  stroke: var(--text-light);
}

.card-back h3 {
  font-size: 2.4rem;
  margin-bottom: 20px;
}

.card-back ul {
  margin-bottom: 20px;
  text-align: left;
  width: 100%;
}

.card-back ul li {
  margin-bottom: 10px;
  position: relative;
  padding-left: 20px;
}

.card-back ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  background-color: var(--text-light);
  border-radius: 50%;
}

/* Contact Section */
#contacto {
  position: relative;
}

.contact-container {
  max-width: 1200px;
  margin: 0 auto;
}

.contact-content {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.contact-content.visible {
  opacity: 1;
  transform: translateY(0);
}

.contact-form-container {
  flex: 1;
  min-width: 300px;
  width: 100%;
}

.contact-form {
  background-color: var(--background-alt);
  border-radius: var(--border-radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 30px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: var(--text-gray);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 15px 0;
  background-color: transparent;
  border: none;
  font-family: inherit;
  font-size: 1.8rem;
  color: var(--text-dark);
  resize: none;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
}

.form-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #ddd;
}

.form-group input:focus ~ .form-line,
.form-group textarea:focus ~ .form-line {
  background-color: var(--primary);
}

.cf-turnstile {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 30px;
  padding-top: 50px;
  padding-bottom: 50px;
}

.submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 40px;
  background-color: var(--primary);
  color: var(--text-light);
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.8rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  width: 100%;
  margin-top: 20px;
  margin-left: auto;
  margin-right: auto;
  max-width: 300px;
}

.submit-button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(227, 6, 19, 0.3);
}

.submit-button svg {
  width: 20px;
  height: 20px;
  margin-left: 10px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-column {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.map-container {
  width: 100%;
  height: 350px;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 10px 0;
}

.contact-item i {
  font-size: 2.4rem;
  color: var(--primary);
  width: 30px;
  display: flex;
  justify-content: center;
}

.contact-item div {
  flex: 1;
}

.contact-item h3 {
  font-size: 1.8rem;
  margin-bottom: 5px;
  font-weight: 700;
}

.contact-item p {
  font-size: 1.6rem;
  color: var(--text-gray);
  line-height: 1.4;
}

.email-link {
  color: var(--text-gray);
  transition: var(--transition);
}

.email-link:hover {
  color: var(--primary);
}

/* Estilos para los iconos de Font Awesome */
.fas,
.fa {
  color: var(--primary);
}

/* Footer - NUEVO */
footer {
  background-color: #333;
  color: var(--text-light);
  padding: 60px 0 20px;
}

footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 40px;
}

.footer-logo {
  flex: 1;
  min-width: 250px;
  margin-bottom: 30px;
}

.footer-logo h2 {
  font-family: "Baloo 2", cursive;
  font-size: 3rem;
  margin-bottom: 15px;
  color: var(--text-light);
}

.footer-logo span {
  font-weight: 400;
}

.footer-logo p {
  font-size: 1.6rem;
  color: #aaa;
  max-width: 300px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.footer-column {
  min-width: 150px;
  position: relative;
}

.footer-column .submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  z-index: 10;
  background: #fff;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  padding: 10px 0;
}

.footer-column .has-submenu:hover .submenu,
.footer-column .has-submenu:focus-within .submenu {
  display: block;
}

.footer-column h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
}

.footer-column h3::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: var(--primary);
}

.footer-column ul {
  list-style: none;
}

.footer-column ul li {
  margin-bottom: 12px;
}

.footer-column ul li a {
  color: #aaa;
  font-size: 1.5rem;
  transition: var(--transition);
}

.footer-column ul li a:hover {
  color: var(--primary-light);
  padding-left: 5px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: 20px;
}

.footer-bottom p {
  font-size: 1.4rem;
  color: #888;
}

.footer-legal a {
  font-size: 1.4rem;
  color: #888;
  transition: var(--transition);
}

.footer-legal a:hover {
  color: var(--primary-light);
}

/* Modal y Toast */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1100;
}

.modal-content {
  background-color: var(--background);
  padding: 30px;
  border-radius: var(--border-radius);
  max-width: 500px;
  width: 90%;
  position: relative;
  text-align: center;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 2.4rem;
  cursor: pointer;
  color: var(--text-gray);
}

.modal-content h2 {
  font-size: 2.4rem;
  margin-bottom: 15px;
  color: var(--primary);
}

.modal-content p {
  font-size: 1.6rem;
  color: var(--text-gray);
}

/* 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: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--primary-dark);
  transform: translateY(-5px);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Añadir imagen de fondo a la sección principal */
#inicio {
  position: relative;
}

#inicio::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("../media/education-background.png");
  background-size: cover;
  background-position: center;
  opacity: 0.25;
  z-index: -1;
  filter: blur(3px);
}

/* Responsive Styles - MEJORADOS */
/* Desktops grandes (1201px+) */
@media (min-width: 1201px) {
  .section {
    padding: 120px 60px;
  }

  .hero-logo {
    height: 140px;
  }

  .feature-bubble {
    width: 130px;
    height: 130px;
  }

  .section-title {
    font-size: 5.2rem;
  }
}

/* Laptops/Desktops pequeños (1025px-1200px) */
@media (max-width: 1200px) {
  .section {
    padding: 80px 40px;
  }

  .product-features {
    flex-direction: column;
    align-items: center;
  }

  .product-showcase,
  .feature-list {
    max-width: 600px;
    width: 100%;
  }

  footer .container {
    padding: 0 30px;
  }

  .hero-logo {
    height: 110px;
  }

  .section-title {
    font-size: 4.2rem;
  }
}

/* Tablets (769px-1024px) */
@media (max-width: 1024px) {
  html {
    font-size: 58%;
  }

  .section {
    padding: 70px 30px;
    min-height: auto;
  }

  .hero-logo {
    height: 100px;
    top: 14%; 
  }

  .hero-logo.scrolled {
    height: 50px;
  }

  .feature-bubble {
    width: 110px;
    height: 110px;
  }

  .module-card {
    width: 240px;
    height: 280px;
  }

  .card-front,
  .card-back {
    padding: 20px;
  }

  .contact-form {
    padding: 30px;
  }

  .footer-links {
    width: 100%;
    justify-content: space-between;
  }

  .footer-column {
    flex-direction: column;
  }
}

/* Dispositivos móviles grandes/tablets pequeñas (481px-768px) */
@media (max-width: 768px) {
  html {
    font-size: 55%;
  }

  .main-header {
    padding: 15px 20px;
  }

  .main-header.scrolled {
    padding: 10px 20px;
  }

  .main-nav {
    display: none;
  }

  .main-nav.active {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--background);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }

  .nav-links {
    flex-direction: column;
    align-items: center;
  }

  .nav-link {
    font-size: 2.4rem;
    margin: 15px 0;
  }

  .menu-toggle {
    display: flex;
  }

  .section {
    padding: 60px 20px;
  }

  .section-title {
    font-size: 3.8rem;
  }

  .section-header p {
    font-size: 1.6rem;
  }

  .app-features {
    flex-wrap: wrap;
    gap: 15px;
  }

  .feature-bubble {
    width: 100px;
    height: 100px;
  }

  .hero-logo {
    height: 90px;
    top: 19%;
  }

  .hero-logo.scrolled {
    left: 20px;
    height: 40px;
  }

  .header-title {
    font-size: 2.4rem;
  }

  .contact-content {
    flex-direction: column;
  }

  .contact-column {
    width: 100%;
  }

  .map-container {
    height: 300px;
  }

  .footer-content {
    flex-direction: column;
  }

  .footer-links {
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .module-card {
    width: 220px;
    height: 260px;
  }

  .module-icon {
    width: 70px;
    height: 70px;
  }

  .card-front h3,
  .card-back h3 {
    font-size: 2rem;
  }
}

/* Dispositivos móviles pequeños (320px-480px) */
@media (max-width: 480px) {
  html {
    font-size: 50%;
  }

  .section {
    padding: 50px 15px;
  }

  .main-header {
    padding: 10px 15px;
  }

  .main-header.scrolled {
    padding: 8px 15px;
  }

  .title {
    font-size: 3.2rem;
  }

  .subtitle {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 3.2rem;
  }

  .app-features {
    display: grid;
    grid-template-columns: repeat(2, 2fr);
  }

  .feature-bubble {
    width: 80px;
    height: 80px;
    margin: 5px;
  }

  .bubble-icon svg {
    width: 24px;
    height: 24px;
  }

  .feature-bubble span {
    font-size: 1.2rem;
  }

  .hero-logo {
    height: 80px;
    top: 18%;
  }

  .hero-logo.scrolled {
    left: 15px;
    height: 30px;
  }

  .header-title {
    font-size: 2rem;
  }

  .product-image {
    height: auto;
  }

  .product-tabs {
    gap: 5px;
  }

  .tab-btn {
    padding: 8px 15px;
    font-size: 1.4rem;
  }

  .feature-item {
    gap: 15px;
  }

  .feature-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
  }

  .feature-icon svg {
    width: 24px;
    height: 24px;
  }

  .feature-content h3 {
    font-size: 1.8rem;
  }

  .feature-content p {
    font-size: 1.4rem;
  }

  .module-card {
    width: 100%;
    width: 240px;
    height: 240px;
  }

  .modules-grid {
    gap: 20px;
  }

  .contact-form {
    padding: 20px;
  }

  .form-group input,
  .form-group textarea {
    font-size: 1.6rem;
  }

  .submit-button {
    padding: 12px 30px;
    font-size: 1.6rem;
  }

  .map-container {
    height: 250px;
  }

  .contact-item i {
    font-size: 2rem;
  }

  .contact-item h3 {
    font-size: 1.6rem;
  }

  .contact-item p {
    font-size: 1.4rem;
  }

  footer .container {
  padding: 0 15px;
  max-width: 1200px;
  margin: 0 auto;
}


  .footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px 0;
}

.footer-links {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #334155;
  padding: 15px 0;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-bottom p,
.footer-legal a {
  margin: 0;
  color: #d1d5db;
  text-decoration: none;
}

.footer-legal a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    align-items: left;
    text-align: left;
  }

  .footer-links {
    flex-direction: column;
    align-items: left;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

}

/* Dispositivos muy pequeños (menos de 320px) */
@media (max-width: 320px) {
  html {
    font-size: 45%;
  }

  .feature-bubble {
    width: 70px;
    height: 70px;
  }

  .hero-logo {
    height: 70px;
  }

  .hero-logo.scrolled {
    height: 25px;
  }

  .module-card {
    height: 220px;
  }

  .card-front,
  .card-back {
    padding: 15px;
  }

  .module-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
  }

  .card-front h3,
  .card-back h3 {
    font-size: 1.8rem;
    margin-bottom: 8px;
  }

  .card-front p {
    font-size: 1.4rem;
    margin-bottom: 10px;
  }

  .flip-icon {
    width: 30px;
    height: 30px;
  }
}

/* Añadir después de las media queries */

/* Optimizaciones para dispositivos táctiles */
.touch-device .feature-bubble:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.touch-device .feature-bubble:hover::before {
  opacity: 0;
  transform: scale(0);
}

.touch-device .feature-bubble:hover .bubble-icon svg,
.touch-device .feature-bubble:hover span {
  color: inherit;
  stroke: var(--primary);
  transform: none;
}

.touch-device .feature-bubble.touch-active {
  transform: scale(1.15) translateY(-10px);
  box-shadow: 0 20px 40px rgba(227, 6, 19, 0.3);
}

.touch-device .feature-bubble.touch-active::before {
  opacity: 1;
  transform: scale(1);
}

.touch-device .feature-bubble.touch-active .bubble-icon svg {
  stroke: var(--text-light);
  transform: scale(1.1);
}

.touch-device .feature-bubble.touch-active span {
  color: var(--text-light);
}

/* Mejoras para la accesibilidad */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-logo,
  .hero-logo.scrolled {
    transition: none !important;
  }

  .feature-bubble:hover {
    transform: none;
  }
}

/* Optimizaciones para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
  .feature-bubble:hover {
    transform: none;
    box-shadow: var(--shadow);
  }

  .feature-bubble:hover::before {
    opacity: 0;
    transform: scale(0);
  }

  .feature-bubble:hover .bubble-icon svg,
  .feature-bubble:hover span {
    color: inherit;
    stroke: var(--primary);
    transform: none;
  }

  .module-card:hover .card-front {
    transform: none;
  }

  .module-card:hover .card-back {
    transform: rotateY(180deg);
  }
}

/* Activación táctil para burbujas */
.feature-bubble.touch-active {
  transform: scale(1.15) translateY(-10px);
  box-shadow: 0 20px 40px rgba(227, 6, 19, 0.3);
}

.feature-bubble.touch-active::before {
  opacity: 1;
  transform: scale(1);
}

.feature-bubble.touch-active .bubble-icon svg {
  stroke: var(--text-light);
  transform: scale(1.1);
}

.feature-bubble.touch-active span {
  color: var(--text-light);
}

/* Correcciones específicas para iOS */
@supports (-webkit-touch-callout: none) {
  /* Forzar renderizado de fuentes en iOS */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  .section-title,
  .title,
  .footer-logo h2,
  .header-title {
    font-family: "Baloo 2", -apple-system, BlinkMacSystemFont, cursive;
    font-display: swap;
    -webkit-font-smoothing: antialiased;
  }

  /* Mejorar animaciones en iOS */
  .module-card {
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    -webkit-perspective: 1000px;
    perspective: 1000px;
  }

  .card-front,
  .card-back {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
  }

  .card-back {
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
  }
}
