/* ===== VARIABLES CSS ===== */
:root {
  /* Colors */
  --primary-color: #1e3a8a;
  --secondary-color: #3b82f6;
  --accent-color: #828282;
  --light-blue: #dbeafe;
  --dark-gray: #374151;
  --medium-gray: #6b7280;
  --light-gray: #f3f4f6;
  --white: #ffffff;
  --black: #000000;
  
  /* Typography */
  --font-family: 'Poppins', sans-serif;
  --h1-font-size: 3rem;
  --h2-font-size: 2.5rem;
  --h3-font-size: 2rem;
  --normal-font-size: 1rem;
  --small-font-size: 0.875rem;
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semi-bold: 600;
  --font-bold: 700;
  
  /* Spacing */
  --header-height: 5rem;
  --top-bar-height: 3rem;
  --section-padding: 5rem 0;
  --container-margin: 0 2rem;
  --mb-0-5: 0.5rem;
  --mb-1: 1rem;
  --mb-1-5: 1.5rem;
  --mb-2: 2rem;
  --mb-2-5: 2.5rem;
  --mb-3: 3rem;
  
  /* Transitions */
  --transition: all 0.3s ease;
  --transition-fast: all 0.2s ease;
  
  /* Shadows */
  --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 10px 25px rgba(0, 0, 0, 0.15);
  
  /* Border radius */
  --border-radius: 0.5rem;
  --border-radius-lg: 1rem;
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */
@media screen and (max-width: 768px) {
  :root {
    --h1-font-size: 2rem;
    --h2-font-size: 1.75rem;
    --h3-font-size: 1.5rem;
    --top-bar-height: 2.5rem;
    --header-height: 4rem;
  }
}

@media screen and (max-width: 480px) {
  :root {
    --top-bar-height: 2.5rem;
    --header-height: 4rem;
  }
}

/* ===== BASE ===== */
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--normal-font-size);
  font-weight: var(--font-normal);
  color: var(--dark-gray);
  line-height: 1.6;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
}

h1, h2, h3, h4 {
  color: var(--primary-color);
  font-weight: var(--font-semi-bold);
  line-height: 1.2;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== REUSABLE CSS CLASSES ===== */
.container {
  max-width: 1200px;
  margin: var(--container-margin);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
  padding-left: 1rem;
  padding-right: 1rem;
}

.section {
  padding: var(--section-padding);
}

.section--bg {
  background-color: var(--light-gray);
}

.section__title {
  font-size: var(--h2-font-size);
  text-align: center;
  margin-bottom: var(--mb-1);
  position: relative;
}

.section__title::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 2px;
}

.section__subtitle {
  text-align: center;
  color: var(--medium-gray);
  margin-bottom: var(--mb-3);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: var(--normal-font-size);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  justify-content: center;
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--white);
  box-shadow: var(--shadow-medium);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-heavy);
}

.btn--full {
  width: 100%;
}

/* ===== TOP BAR ===== */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--white);
  padding: 0.75rem 0;
  font-size: var(--small-font-size);
  z-index: 1001;
  transition: var(--transition);
}

.top-bar__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar__info {
  display: flex;
  gap: 2rem;
}

.top-bar__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.9;
}

.top-bar__item i {
  font-size: 0.875rem;
}

.top-bar__cta {
  display: flex;
  align-items: center;
}

.top-bar__button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: var(--font-medium);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.top-bar__button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.top-bar__button i {
  animation: electricPulseTopBar 2s infinite;
}

@keyframes electricPulseTopBar {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: var(--top-bar-height);
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-light);
  z-index: 1000;
  transition: var(--transition);
  padding-top: 0.75rem;
  padding-bottom: 0.25rem;
  min-height: var(--header-height);
}

.nav {
  height: calc(var(--header-height) - 1rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: var(--font-bold);
  color: var(--primary-color);
  cursor: pointer;
  transition: var(--transition);
}

.nav__logo:hover {
  transform: scale(1.05);
}

.nav__logo i {
  color: var(--primary-color);
  font-size: 1.5rem;
  animation: electricPulse 2s infinite;
  filter: drop-shadow(0 0 3px rgba(30, 58, 138, 0.5));
}

@keyframes electricPulse {
  0%, 100% {
    color: var(--primary-color);
    transform: scale(1);
    filter: drop-shadow(0 0 3px rgba(30, 58, 138, 0.5));
  }
  25% {
    color: var(--secondary-color);
    transform: scale(1.1);
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.7));
  }
  50% {
    color: var(--primary-color);
    transform: scale(1.05);
    filter: drop-shadow(0 0 4px rgba(30, 58, 138, 0.6));
  }
  75% {
    color: var(--secondary-color);
    transform: scale(1.08);
    filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.6));
  }
}

.nav__list {
  display: flex;
  gap: 2rem;
}

.nav__link {
  color: var(--dark-gray);
  font-weight: var(--font-medium);
  transition: var(--transition);
  position: relative;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
}

.nav__link:hover {
  color: var(--primary-color);
  transform: translateY(-1px);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease;
}

.nav__link:hover::after {
  width: 100%;
}

.nav__toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--primary-color);
  cursor: pointer;
  transition: var(--transition);
  background: none;
  border: none;
  padding: 0.5rem;
}

.nav__toggle:hover {
  transform: scale(1.1);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero__slide.active {
  opacity: 1;
}

.hero__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.8), rgba(59, 130, 246, 0.6));
  z-index: 2;
}

.hero__content {
  position: relative;
  z-index: 3;
  text-align: center;
  color: var(--white);
  animation: fadeInUp 1s ease-out;
  padding-top: calc(var(--header-height) + var(--top-bar-height) + 2rem);
}

.hero__title {
  font-size: var(--h1-font-size);
  font-weight: var(--font-bold);
  margin-bottom: var(--mb-1);
  color: var(--white);
}

.hero__subtitle {
  font-size: 1.25rem;
  margin-bottom: var(--mb-2-5);
  opacity: 0.9;
}

.hero__cta {
  font-size: 1.1rem;
  padding: 1.25rem 2.5rem;
  background: var(--black);
  border: 2px solid var(--black);
  color: var(--white);
}

.hero__cta:hover {
  background: transparent;
  color: var(--black);
  border-color: var(--black);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* ===== SERVICES ===== */
.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: var(--mb-3);
}

.service__card {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-light);
  text-align: center;
  transition: var(--transition);
  border: 1px solid transparent;
}

.service__card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-heavy);
  border-color: var(--primary-color);
}

.service__icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--mb-1);
}

.service__icon i {
  font-size: 2rem;
  color: var(--white);
}

.service__title {
  font-size: 1.25rem;
  margin-bottom: var(--mb-1);
  color: var(--primary-color);
}

.service__description {
  color: var(--medium-gray);
  line-height: 1.6;
}

/* ===== WHY US ===== */
.why-us__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: var(--mb-3);
}

.why-us__card {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-light);
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.why-us__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: var(--transition);
  will-change: transform;
}

.why-us__card:hover::before {
  left: 100%;
}

.why-us__card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-medium);
}

.why-us__icon {
  width: 70px;
  height: 70px;
  background: var(--light-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--mb-1);
}

.why-us__icon i {
  font-size: 1.75rem;
  color: var(--primary-color);
}

.why-us__title {
  font-size: 1.1rem;
  margin-bottom: var(--mb-0-5);
  color: var(--primary-color);
}

.why-us__description {
  color: var(--medium-gray);
  font-size: var(--small-font-size);
}

/* ===== TESTIMONIALS ===== */
.testimonials__carousel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: var(--mb-3);
}

.testimonial__card {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-light);
  position: relative;
}

.testimonial__card::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 4rem;
  color: var(--primary-color);
  opacity: 0.3;
}

.testimonial__content p {
  font-style: italic;
  margin-bottom: var(--mb-1-5);
  color: var(--dark-gray);
}

.testimonial__author strong {
  color: var(--primary-color);
  display: block;
}

.testimonial__author span {
  color: var(--medium-gray);
  font-size: var(--small-font-size);
}

/* ===== PORTFOLIO ===== */
.portfolio__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: var(--mb-3);
}

.portfolio__item {
  position: relative;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  cursor: pointer;
}

.portfolio__item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-heavy);
}

.portfolio__img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: var(--transition);
  filter: brightness(1);
}

.portfolio__item:hover .portfolio__img {
  transform: scale(1.05);
  filter: brightness(1.1) contrast(1.1);
}

/* ===== CONTACT ===== */
.contact__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: var(--mb-3);
}

.contact__form {
  background: var(--white);
  padding: 2.5rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-medium);
}

.form__group {
  position: relative;
  margin-bottom: var(--mb-2);
}

.form__input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: var(--normal-font-size);
  transition: var(--transition);
  background: transparent;
}

.form__input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form__label {
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: var(--medium-gray);
  font-size: var(--normal-font-size);
  transition: var(--transition);
  pointer-events: none;
}

.form__input:focus + .form__label,
.form__input:not(:placeholder-shown) + .form__label,
.form__input:valid + .form__label {
  top: -0.5rem;
  left: 0.75rem;
  font-size: var(--small-font-size);
  color: var(--primary-color);
  background: var(--white);
  padding: 0 0.5rem;
  z-index: 10;
}

.form__input:not(:placeholder-shown) {
  border-color: var(--primary-color);
}

.form__input::placeholder {
  opacity: 0;
  transition: var(--transition);
}

.form__input:focus::placeholder {
  opacity: 0.7;
}

.form__textarea {
  resize: vertical;
  min-height: 120px;
}

/* ===== RECAPTCHA STYLES ===== */
.g-recaptcha {
  margin: 1rem 0;
  display: flex;
  justify-content: center;
}

.contact__info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact__item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.contact__icon {
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact__icon i {
  color: var(--white);
  font-size: 1.25rem;
}

.contact__details h4 {
  margin-bottom: var(--mb-0-5);
  color: var(--primary-color);
}

.contact__details p {
  color: var(--medium-gray);
}

.contact__social {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact__social-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  transition: var(--transition);
  font-size: var(--small-font-size);
}

.contact__social-link:hover {
  color: var(--secondary-color);
  transform: translateX(5px);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--primary-color);
  color: var(--white);
  padding: 3rem 0 1rem;
}

.footer__content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: var(--mb-2);
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: var(--font-bold);
  margin-bottom: var(--mb-1);
}

.footer__logo i {
  color: var(--white);
  font-size: 1.5rem;
  animation: electricPulseFooter 3s infinite;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
}

@keyframes electricPulseFooter {
  0%, 100% {
    color: var(--white);
    transform: scale(1);
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
  }
  33% {
    color: #60a5fa;
    transform: scale(1.05);
    filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.6));
  }
  66% {
    color: var(--white);
    transform: scale(1.02);
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.4));
  }
}

.footer__description {
  opacity: 0.8;
  line-height: 1.6;
}


.footer__title {
  margin-bottom: var(--mb-1);
  font-size: 1.1rem;
  color: var(--white);
}

.footer__contact p {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.footer__social {
  display: flex;
  gap: 1rem;
}

.footer__social-link {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.footer__social-link:hover {
  background: var(--primary-color);
  transform: translateY(-3px) scale(1.1);
}

.footer__services {
  list-style: none;
  padding: 0;
}

.footer__services li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  opacity: 0.9;
  font-size: var(--small-font-size);
}

.footer__services i {
  color: var(--accent-color);
  font-size: 0.75rem;
}

.footer__cta-text {
  opacity: 0.9;
  margin-bottom: var(--mb-1-5);
  font-size: var(--small-font-size);
  line-height: 1.5;
}

.footer__cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-color);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: var(--font-medium);
  font-size: var(--small-font-size);
  transition: var(--transition);
  border: 2px solid var(--accent-color);
}

.footer__cta-button:hover {
  background: transparent;
  color: var(--accent-color);
  transform: translateY(-2px);
}

.footer__cta-button i {
  animation: electricPulseFooterCTA 2s infinite;
}

@keyframes electricPulseFooterCTA {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.footer__bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.8;
}

.footer__bottom a {
  color: var(--white);
  text-decoration: underline;
  transition: var(--transition);
}

.footer__bottom a:hover {
  color: #60a5fa;
  text-decoration: none;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-up {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* ===== WHATSAPP FLOATING BUTTON ===== */
.whatsapp-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  transition: var(--transition);
  animation: whatsappPulse 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-float i {
  font-size: 2rem;
  color: var(--white);
}

@keyframes whatsappPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
  }
}

/* ===== MOBILE MENU OVERLAY SYSTEM ===== */
@media screen and (max-width: 768px) {
  /* Crear un menú móvil completamente independiente del nav container */
  .nav__menu {
    position: fixed;
    top: 0;
    left: -100vw;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 10000;
    transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    max-width: none;
    box-shadow: none;
    border: none;
    transform: translateZ(0);
    will-change: left;
    contain: layout style paint;
    /* Forzar escape del container padre */
    position: fixed !important;
    left: -100vw !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10000 !important;
  }
  
  .nav__menu.show-menu {
    left: 0 !important;
  }
  
  /* Resetear cualquier regla del container padre */
  .nav {
    overflow: visible !important;
    position: relative !important;
  }
  
  .header {
    overflow: visible !important;
  }
  
  .container {
    overflow: visible !important;
  }
}
@media screen and (max-width: 768px) {
  /* Asegurar separación correcta entre top-bar y header */
  .top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
    height: var(--top-bar-height);
  }
  
  .header {
    position: fixed;
    top: var(--top-bar-height);
    left: 0;
    width: 100%;
    z-index: 1000;
    margin-top: 0;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
  
  /* Resetear el container para el nav */
  .nav.container {
    max-width: none;
    padding-left: 1rem;
    padding-right: 1rem;
    margin: 0;
    width: 100%;
  }
  
  .container {
    margin-left: 1rem;
    margin-right: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    width: calc(100% - 2rem);
    max-width: calc(100% - 2rem);
  }
  
  .top-bar__content {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .nav {
    padding-left: 1rem;
    padding-right: 1rem;
    position: relative;
    overflow: visible;
  }
  
  .top-bar__info {
    gap: 1.5rem;
  }
  
  .top-bar__cta {
    display: none;
  }
  
  /* Menu móvil - posicionado fuera del flujo normal */
  .nav__menu {
    position: fixed;
    top: 0;
    left: -100vw;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 10000;
    transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    max-width: none;
    box-shadow: none;
    border: none;
  }
  
  /* Menu móvil - visible cuando tiene clase show-menu */
  .nav__menu.show-menu {
    left: 0;
  }
  
  .nav__list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    padding: 2rem;
    width: 100%;
    max-width: 350px;
    list-style: none;
    margin: 0;
  }
  
  .nav__item {
    width: 100%;
  }
  
  .nav__link {
    display: block;
    width: 100%;
    text-align: center;
    padding: 1.25rem 2rem;
    font-size: 1.2rem;
    font-weight: var(--font-medium);
    color: var(--dark-gray);
    background: var(--white);
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius-lg);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
  }
  
  .nav__link:hover,
  .nav__link:focus {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
  }
  
  /* Toggle button */
  .nav__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    position: relative;
    width: 40px;
    height: 40px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: none;
    cursor: pointer;
  }
  
  .nav__toggle i {
    font-size: 1.4rem;
    transition: var(--transition);
    color: var(--primary-color);
  }
  
  .nav__logo {
    z-index: 10001;
    position: relative;
  }
  
  /* Forzar que el menú en desktop se oculte en móvil */
  .nav__list:not(.nav__menu .nav__list) {
    display: none;
  }
  
  /* Asegurar que el menú móvil escape del container */
  .nav__menu {
    transform: translateZ(0);
    will-change: left;
    contain: layout style paint;
    position: fixed;
    top: 0;
    left: -100vw;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 10000;
    transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Prevenir scroll del body cuando el menú está abierto */
  body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }
  
  .services__grid,
  .why-us__grid,
  .testimonials__carousel,
  .portfolio__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-left: 0;
    margin-right: 0;
  }
  
  .service__card,
  .why-us__card,
  .testimonial__card,
  .portfolio__item {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
    height: auto;
    min-height: auto;
  }
  
  .contact__content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .contact__form,
  .contact__info {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .footer__content {
    grid-template-columns: 1fr;
    text-align: left;
  }
  
  .footer__logo {
    justify-content: flex-start;
  }
  
  .footer__social {
    justify-content: flex-start;
  }
  
  .footer__cta-button {
    align-self: flex-start;
  }
  
  .whatsapp-float {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 55px;
    height: 55px;
  }
  
  .whatsapp-float i {
    font-size: 1.75rem;
  }
}

@media screen and (max-width: 480px) {
  /* Asegurar separación correcta en móviles pequeños */
  .top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 1003;
    height: var(--top-bar-height);
  }

  .header {
    position: fixed;
    top: var(--top-bar-height);
    left: 0;
    width: 100%;
    z-index: 1002;
    margin-top: 0;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
  }

  .container {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    width: calc(100% - 1.5rem);
    max-width: calc(100% - 1.5rem);
  }

  .top-bar__content {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .nav {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .g-recaptcha {
    transform: scale(0.85);
    transform-origin: center;
  }

  .nav__logo {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  .nav__logo i {
    font-size: 1.2rem;
  }

  .nav__toggle {
    width: 36px;
    height: 36px;
  }

  .nav__toggle i {
    font-size: 1.2rem;
  }

  .hero__content {
    padding: 0 0.75rem;
    padding-top: calc(var(--header-height) + var(--top-bar-height) + 1rem);
  }

  .service__card,
  .why-us__card,
  .testimonial__card {
    padding: 1.5rem;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
    min-height: auto;
    height: auto;
    max-height: none;
  }

  .contact__form {
    padding: 1.5rem;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .btn {
    padding: 0.875rem 1.5rem;
  }

  .whatsapp-float {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
  }

  .whatsapp-float i {
    font-size: 1.5rem;
  }

  /* Menu móvil más compacto en pantallas pequeñas */
  .nav__menu {
    padding: 0 !important;
  }

  .nav__list {
    gap: 1.5rem !important;
    padding: 1.5rem !important;
    max-width: 300px !important;
  }

  .nav__link {
    padding: 1rem 1.5rem !important;
    font-size: 1.1rem !important;
  }

  /* Asegurar que todos los elementos respeten el ancho */
  .services__grid,
  .why-us__grid,
  .testimonials__carousel,
  .portfolio__grid {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
  }

  .portfolio__item,
  .testimonial__card,
  .service__card,
  .why-us__card {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    overflow: visible;
    height: auto;
  }
}

/* ===== MOBILE OVERFLOW PREVENTION ===== */
@media screen and (max-width: 768px) {
  /* Prevenir overflow horizontal global */
  html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }
  
  * {
    box-sizing: border-box;
  }
  
  .section {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }
  
  .top-bar,
  .header,
  .hero,
  .footer {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  /* Grillas responsive sin overflow */
  .services__grid,
  .why-us__grid,
  .testimonials__carousel,
  .portfolio__grid,
  .contact__content,
  .footer__content {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    margin-left: 0;
    margin-right: 0;
  }
  
  /* Cards sin scroll interno */
  .service__card,
  .why-us__card,
  .testimonial__card,
  .portfolio__item,
  .contact__form,
  .contact__info {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    overflow: visible;
    height: auto;
    min-height: auto;
    max-height: none;
  }
  
  /* Contenido de cards sin restricciones de altura */
  .service__description,
  .why-us__description,
  .testimonial__content,
  .service__title,
  .why-us__title,
  .testimonial__author {
    overflow: visible;
    height: auto;
    max-height: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Imágenes responsive */
  img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
  }
  
  .portfolio__img,
  .hero__slide img {
    width: 100%;
    max-width: 100%;
    object-fit: cover;
  }
  
  /* Textos sin desbordamiento */
  p, h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow: visible;
  }
}