/* Interactividad añadida a la web de MC Asesoría (sin librerías). */

/* 1. Barra fija: "Pedir cita" visible también en móvil */
@media (max-width: 900px) {
  .header-cta {
    display: inline-flex;
    margin-left: auto;
    margin-right: -10px; /* acerca el menú de las tres rayitas al botón */
    min-height: 38px;
    padding: 8px 12px;
    font-size: 11px;
  }
  /* Icono del menú más grande y fácil de tocar */
  .mobile-toggle { width: 46px; height: 46px; padding: 0; }
  .mobile-toggle svg { width: 30px; height: 30px; }
}
@media (max-width: 380px) {
  .header-cta svg { display: none; }
  .header-cta { padding: 8px 10px; }
}
/* Móviles muy estrechos (320–359 px): que la cabecera quepa sin salirse */
@media (max-width: 359px) {
  .header-inner { gap: 8px; padding-left: 14px; padding-right: 14px; }
  .brand-name { font-size: 18px; }
  .header-cta { margin-right: 0; padding: 7px 9px; font-size: 10.5px; }
  .hero-copy h1 { font-size: 39px; }
}

/* 2. Sección actual resaltada en el menú */
.desktop-nav > a[aria-current="location"] { color: var(--green); }
.desktop-nav > a[aria-current="location"]::after { right: 0; }
.mobile-nav a[aria-current="location"] { color: var(--green); font-weight: 700; }

/* 4. Botón de volver arriba (encima del de WhatsApp) */
.mc-top {
  position: fixed;
  right: 27px;
  bottom: 86px;
  z-index: 40;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 10px 26px rgba(22, 35, 44, 0.2);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s, background 0.2s;
}
.mc-top.is-visible { opacity: 1; visibility: visible; transform: none; }
@media (max-width: 600px) {
  .mc-top { right: 22px; bottom: 80px; }
}
.mc-top:hover { background: var(--deep); transform: translateY(-2px); }
.mc-top:focus-visible { outline: 3px solid rgb(185, 151, 78); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) {
  .mc-top, .mc-top:hover { transition: none; transform: none; }
}

/* 5. Aparición suave al bajar (solo si el usuario no pide reducir el movimiento) */
@media (prefers-reduced-motion: no-preference) {
  .mc-reveal {
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: var(--mc-retraso, 0ms);
  }
  .mc-reveal:not(.is-visible) {
    opacity: 0;
    transform: translateY(18px);
  }
}

/* 5. Efectos al pasar el ratón por tarjetas y botones */
@media (hover: hover) {
  .service-row,
  .steps-list > li,
  .trust-inner > div,
  .hero-consultation {
    transition: background 0.2s, box-shadow 0.25s, transform 0.25s;
  }
  .service-row:hover {
    box-shadow: 0 10px 28px rgba(36, 43, 97, 0.07);
  }
  .service-row:hover .service-icon { color: var(--green); }
  .steps-list > li:hover,
  .hero-consultation:hover {
    transform: translateY(-2px);
  }
  .trust-inner > div:hover { transform: translateY(-2px); }
  .service-link:hover,
  .text-link:hover { color: var(--green); }
  .faq-list summary:hover { color: var(--green); }
}
@media (prefers-reduced-motion: reduce) {
  .steps-list > li:hover,
  .hero-consultation:hover,
  .trust-inner > div:hover { transform: none; }
}

/* 6. Preguntas frecuentes: apertura suave (en navegadores que lo permiten; en el resto, al instante) */
@media (prefers-reduced-motion: no-preference) {
  .faq-list details { interpolate-size: allow-keywords; }
  .faq-list details::details-content {
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease, content-visibility 0.3s allow-discrete;
  }
  .faq-list details[open]::details-content { height: auto; }
}

/* 7. Menú del móvil: zona de toque cómoda (mín. 44 px) y aparición suave */
.mobile-toggle { min-width: 44px; min-height: 44px; flex-shrink: 0; }
@media (prefers-reduced-motion: no-preference) {
  .mobile-nav { animation: mc-menu 0.22s ease; }
}
@keyframes mc-menu {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* 1. Barra de progreso de lectura */
.mc-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 41;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ------------------------------------------------------------------
   Tamaños de letra más legibles (móvil primero; ordenador más abajo).
   Texto normal a 16-18 px; títulos, botones y etiquetas en proporción.
   ------------------------------------------------------------------ */

/* Texto normal */
.hero-description,
.cf-contact-description { font-size: 17px; }
.service-description,
.service-title p,
.steps-list p,
.about-copy p,
.faq-list details p,
.faq-intro p,
.process-intro p,
.section-heading p,
.process-intro > p:not(.eyebrow),
.about-copy > p:not(.eyebrow),
.faq-intro > p:not(.eyebrow),
.process-promise span { font-size: 16px; }

/* Títulos */
#main-content h2 { font-size: 37px; }
.service-row h3 { font-size: 18px; }
.steps-list h3 { font-size: 17px; }
.faq-list summary { font-size: 16px; }
.faq-number { font-size: 12px; }

/* Botones y enlaces */
.hero-actions .button,
.text-link,
.cf-button,
.cf-button span { font-size: 15px; }
.service-link { font-size: 14px; }
.hero-actions { flex-wrap: wrap; row-gap: 14px; }
.text-link, .button { white-space: nowrap; }
.cf-direct-details a,
.cf-direct-details a span { font-size: 15px; }
.cf-whatsapp-float-text { font-size: 14px; }
.mobile-nav a { font-size: 17px; }

/* Etiquetas y textos pequeños */
.eyebrow,
.hero-copy .eyebrow,
.section-heading .eyebrow,
.process-intro .eyebrow,
.about-copy .eyebrow,
.faq-intro .eyebrow,
.cf-eyebrow { font-size: 11px; }
.hero-footnote { flex-wrap: nowrap; align-items: flex-start; }
.hero-footnote svg { flex-shrink: 0; margin-top: 3px; }
.hero-footnote,
.service-note,
.paid-note,
.about-pills span,
.photo-caption { font-size: 13px; }
.trust-inner p strong { font-size: 15px; }
.trust-inner p span { font-size: 13px; }
.step-number { font-size: 13px; }
.hero-consultation strong { font-size: 15px; }
.hero-consultation p,
.hero-consultation a { font-size: 13px; }
.signature span { font-size: 10px; }

/* Pie de página */
.cf-footer p,
.cf-address span,
.cf-hours p,
.cf-legal-links button,
.cf-social-links a { font-size: 14px; }
.cf-footer-column h3 { font-size: 12px; }
.cf-footer-bottom p { font-size: 12.5px; }

/* Ordenador */
@media (min-width: 901px) {
  .hero-description,
  .cf-contact-description { font-size: 18px; }
  .service-description,
  .service-title p,
  .steps-list p,
  .about-copy p,
  .faq-list details p,
  .faq-intro p,
  .process-intro p,
  .section-heading p,
  .process-intro > p:not(.eyebrow),
  .about-copy > p:not(.eyebrow),
  .faq-intro > p:not(.eyebrow),
  .process-promise span { font-size: 17px; }
  #main-content h2 { font-size: 47px; }
  .service-row h3 { font-size: 19px; }
  .steps-list h3 { font-size: 18px; }
  .faq-list summary { font-size: 17px; }
  .eyebrow, .hero-copy .eyebrow, .section-heading .eyebrow, .process-intro .eyebrow,
  .about-copy .eyebrow, .faq-intro .eyebrow, .cf-eyebrow { font-size: 12px; }
  .desktop-nav > a { font-size: 11px; }
  .header-cta { font-size: 12px; }
}
@media (min-width: 1101px) {
  .desktop-nav > a { font-size: 13px; }
  .header-cta { font-size: 13px; }
}

/* ------------------------------------------------------------------
   Formulario de contacto (assets/formulario.js)
   ------------------------------------------------------------------ */
.mc-form-section {
  background: var(--cream);
  padding: 56px 0 64px;
  border-bottom: 1px solid var(--line);
}
.mc-form-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 23px;
  display: grid;
  gap: 28px;
}
.mc-form-intro h2 {
  color: var(--navy);
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 400;
  font-size: 34px;
  line-height: 1.15;
  margin: 12px 0 12px;
}
.mc-form-intro > p:not(.eyebrow) { color: var(--muted); font-size: 16px; line-height: 1.7; }
.mc-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 20px;
  box-shadow: 0 10px 30px rgba(36, 43, 97, 0.05);
}
.mc-form-grid { display: grid; gap: 0 18px; }
.mc-field { margin-bottom: 16px; }
.mc-field label { display: block; color: var(--navy); font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.mc-field label span[aria-hidden] { color: var(--green); }
.mc-opcional { color: var(--muted); font-weight: 500; }
.mc-field input:not([type="checkbox"]),
.mc-field select,
.mc-field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* 16 px evita que el iPhone haga zoom al escribir */
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfd1cc;
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 48px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.mc-field textarea { resize: vertical; min-height: 96px; }
.mc-field input:focus,
.mc-field select:focus,
.mc-field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(36, 121, 83, 0.18);
}
.mc-field [aria-invalid="true"] { border-color: #b3261e; }
.mc-error { color: #b3261e; font-size: 14px; margin-top: 5px; min-height: 0; }
.mc-error:empty { display: none; }
.mc-ayuda { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 6px; }
.mc-contador { white-space: nowrap; margin-left: 4px; }
.mc-check { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; }
.mc-check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--green); }
.mc-check label { font-weight: 500; color: var(--ink); margin: 0; }
.mc-check .mc-error { grid-column: 1 / -1; }
.mc-link-privacidad {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--green); text-decoration: underline; cursor: pointer;
}
/* Oculto sin sacarlo de la pantalla: con left:-9999px el árabe (derecha a izquierda) se desbordaba */
.mc-trampa { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.mc-enviar { width: 100%; justify-content: center; min-height: 50px; font-size: 16px; border: 0; cursor: pointer; }
.mc-enviar[disabled] { opacity: 0.7; cursor: wait; }
.mc-estado { margin-top: 14px; font-size: 15px; line-height: 1.6; }
.mc-estado:empty { display: none; }
.mc-estado-ok { color: var(--green); font-weight: 700; }
.mc-estado-error { color: #b3261e; }
.mc-estado a { color: var(--green); font-weight: 700; text-decoration: underline; }
.mc-info-legal { margin-top: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.mc-info-legal strong { color: var(--ink); }

@media (min-width: 700px) {
  .mc-form-grid { grid-template-columns: 1fr 1fr; }
  .mc-form { padding: 32px; }
  .mc-enviar { width: auto; padding-left: 40px; padding-right: 40px; }
}
@media (min-width: 901px) {
  .mc-form-section { padding: 88px 0; }
  .mc-form-shell { grid-template-columns: 0.8fr 1.2fr; gap: 64px; padding: 0 40px; align-items: start; }
  .mc-form-intro h2 { font-size: 47px; }
  .mc-form-intro > p:not(.eyebrow) { font-size: 17px; }
}

/* ------------------------------------------------------------------
   Selector de idioma (assets/idiomas.js) y ajustes para el árabe
   ------------------------------------------------------------------ */
.mc-idiomas {
  position: fixed;
  left: 16px;
  bottom: 24px;
  z-index: 40;
  display: flex;
  gap: 2px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(22, 35, 44, 0.14);
}
.mc-idiomas button {
  min-width: 40px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--navy);
  font: 700 13px/1 "Manrope Variable", Manrope, "Segoe UI", Tahoma, sans-serif;
  cursor: pointer;
}
.mc-idiomas button[lang="ar"] { font-size: 16px; }
.mc-idiomas button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.mc-idiomas button:focus-visible { outline: 3px solid rgb(185, 151, 78); outline-offset: 2px; }
.mc-aviso-legal {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f1f3ee;
  color: var(--ink);
  font-size: 14px;
}

/* Árabe: letra que tenga caracteres árabes, sin espaciado entre letras (rompe la escritura) */
html[lang="ar"] body,
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3,
html[lang="ar"] blockquote, html[lang="ar"] .brand-name,
html[lang="ar"] input, html[lang="ar"] select, html[lang="ar"] textarea, html[lang="ar"] button {
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Naskh Arabic", "Geeza Pro", sans-serif;
}
html[lang="ar"] * { letter-spacing: 0 !important; }
html[lang="ar"] em { font-style: normal; }
html[lang="ar"] .brand-name,
html[lang="ar"] .brand-monogram,
html[lang="ar"] .cf-wordmark { font-family: "DM Serif Display", Georgia, serif; }
/* En árabe las flechas apuntan hacia la izquierda */
html[dir="rtl"] .lucide-arrow-right,
html[dir="rtl"] .lucide-arrow-up-right { transform: scaleX(-1); }
/* En árabe, teléfonos y correos se siguen leyendo de izquierda a derecha */
html[dir="rtl"] a[href^="tel:"] span,
html[dir="rtl"] a[href^="mailto:"] span,
html[dir="rtl"] .mc-form input[type="tel"],
html[dir="rtl"] .mc-form input[type="email"] { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .mc-form input[type="tel"],
html[dir="rtl"] .mc-form input[type="email"] { text-align: right; }

/* ------------------------------------------------------------------
   Aviso de disponibilidad (assets/aviso.js)
   ------------------------------------------------------------------ */
.mc-aviso { background: var(--green); color: #fff; }
.mc-aviso-dentro {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 12px 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mc-aviso-dentro > svg { flex-shrink: 0; }
.mc-aviso-texto { flex: 1; margin: 0; font-size: 15px; font-weight: 600; line-height: 1.45; }
.mc-aviso-cerrar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.mc-aviso-cerrar:hover { background: rgba(255, 255, 255, 0.15); }
.mc-aviso-cerrar:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }
@media (min-width: 901px) {
  .mc-aviso-dentro { justify-content: center; }
  .mc-aviso-texto { flex: 0 1 auto; font-size: 16px; }
}
