/* =============================================================================
   MARESME SOL · components.css
   Piezas reutilizables: botones, cabecera, tarjetas, formularios, pie.
   Cualquier página nueva se monta con estos componentes sin escribir CSS extra.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   BOTONES
   ------------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 26px;
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  font-size: .98rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background-color .18s var(--easing), border-color .18s var(--easing),
              color .18s var(--easing), transform .12s var(--easing), box-shadow .18s var(--easing);
}
.btn:active { transform: translateY(1px); }
.btn--bloque { width: 100%; }
.btn--grande { min-height: 60px; padding: 16px 34px; font-size: 1.05rem; }

.btn--sol {
  background: var(--sol); color: #fff;
  box-shadow: var(--sombra-sol);
}
.btn--sol:hover { background: var(--sol-claro); }

.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: var(--wa-oscuro); }

.btn--linea {
  background: transparent; color: var(--mar);
  border-color: var(--linea);
}
.btn--linea:hover { border-color: var(--mar); background: var(--papel); }

.btn--claro { background: #fff; color: var(--mar); }
.btn--claro:hover { background: var(--sol-suave); }

.btn--fantasma {
  background: transparent; color: #fff;
  border-color: rgba(255,255,255,.35);
}
.btn--fantasma:hover { border-color: #fff; background: rgba(255,255,255,.08); }

.btn__icono { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------------------------------------------------------------------------
   CABECERA
   ------------------------------------------------------------------------ */
.cabecera {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251, 247, 242, .88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--easing), box-shadow .2s var(--easing);
}
.cabecera.is-scrolled { border-bottom-color: var(--linea); box-shadow: var(--sombra-s); }

.cabecera__inner {
  display: flex; align-items: center; gap: 22px;
  min-height: var(--header-h);
}

.marca { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.marca__icono { width: 34px; height: 34px; }
.marca__texto {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.24rem;
  letter-spacing: -.02em;
  color: var(--mar);
  line-height: 1;
}
.marca__texto span { color: var(--sol); }

.nav { margin-left: auto; display: none; }
.nav__lista { display: flex; gap: 30px; }
.nav__enlace {
  font-size: .95rem; font-weight: 500; color: var(--tinta-suave);
  padding: 8px 0; border-bottom: 2px solid transparent;
  transition: color .18s var(--easing), border-color .18s var(--easing);
}
.nav__enlace:hover,
.nav__enlace[aria-current="page"] { color: var(--mar); border-bottom-color: var(--sol); }

.cabecera__acciones { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.nav + .cabecera__acciones { margin-left: 0; }
.cabecera__acciones .btn { min-height: 44px; padding: 10px 20px; font-size: .9rem; }

/* Botón hamburguesa.
   Ojo con el orden: la regla que lo oculta en escritorio va DESPUÉS de esta,
   porque con la misma especificidad gana la última declarada. */
.hamburguesa {
  margin-left: auto;
  width: 46px; height: 46px;
  display: grid; place-content: center; gap: 5px;
  background: transparent; border: 1.5px solid var(--linea);
  border-radius: var(--r-s); cursor: pointer;
}
.hamburguesa span {
  display: block; width: 20px; height: 2px;
  background: var(--mar); border-radius: 2px;
  transition: transform .22s var(--easing), opacity .18s var(--easing);
}
.hamburguesa[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburguesa[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburguesa[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menú desplegable en móvil */
.menu-movil {
  position: fixed; inset: var(--header-h) 0 0 0;
  background: var(--arena);
  padding: 28px 22px 40px;
  display: flex; flex-direction: column; gap: 6px;
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: opacity .2s var(--easing), transform .2s var(--easing);
  z-index: 55; overflow-y: auto;
}
.menu-movil.is-open { opacity: 1; transform: none; pointer-events: auto; }
.menu-movil a.menu-movil__enlace {
  font-family: var(--display); font-size: 1.5rem; font-weight: 600;
  color: var(--mar); padding: 14px 0; border-bottom: 1px solid var(--linea);
}
.menu-movil__acciones { margin-top: 26px; display: grid; gap: 12px; }

/* Cambio de navegación: menú completo en escritorio, hamburguesa en móvil. */
@media (min-width: 980px) {
  .nav { display: block; }
  .hamburguesa { display: none; }
  .menu-movil { display: none; }
  .cabecera__acciones .btn--linea { display: inline-flex; }
}
@media (max-width: 979px) {
  .cabecera__acciones .btn--linea { display: none; }
}

/* En pantallas muy estrechas (360 px) el logotipo, el botón de WhatsApp y la
   hamburguesa no caben en una línea y la cabecera empuja el ancho de la página.
   Se compacta todo lo justo para que quepa. */
@media (max-width: 400px) {
  .cabecera__inner { gap: 12px; }
  .marca__texto { font-size: 1.08rem; }
  .marca__icono { width: 30px; height: 30px; }
  .cabecera__acciones .btn { padding: 10px 15px; font-size: .86rem; }
  .hamburguesa { width: 42px; height: 42px; }
}

/* ---------------------------------------------------------------------------
   TARJETAS
   ------------------------------------------------------------------------ */
.tarjeta {
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: var(--r-m);
  padding: 30px 28px;
  box-shadow: var(--sombra-s);
  transition: transform .2s var(--easing), box-shadow .2s var(--easing);
}
.tarjeta--enlace:hover { transform: translateY(-4px); box-shadow: var(--sombra-m); }
.tarjeta__icono {
  width: 52px; height: 52px;
  display: grid; place-content: center;
  background: var(--sol-suave); color: var(--sol-texto);
  border-radius: var(--r-s); margin-bottom: 18px;
}
.tarjeta h3 { margin-bottom: 8px; }
.tarjeta p { color: var(--tinta-suave); font-size: .96rem; }

/* Tarjeta de servicio principal (las tres líneas de negocio) */
.servicio {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: var(--r-g);
  padding: 34px 30px 30px;
  overflow: hidden;
  transition: transform .22s var(--easing), box-shadow .22s var(--easing);
}
.servicio::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--sol);
}
.servicio:hover { transform: translateY(-6px); box-shadow: var(--sombra-m); }
.servicio__etiqueta {
  font-size: .74rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--sol-texto); margin-bottom: 14px;
}
.servicio h3 { font-size: 1.5rem; margin-bottom: 10px; }
.servicio p { color: var(--tinta-suave); font-size: .98rem; }
.servicio__lista { margin: 18px 0 26px; display: grid; gap: 10px; }
.servicio__lista li {
  position: relative; padding-left: 26px;
  font-size: .94rem; color: var(--tinta-suave);
}
.servicio__lista li::before {
  content: ""; position: absolute; left: 0; top: .45em;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--sol-suave)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23B8431A'%3E%3Cpath d='M8.2 13.6 4.9 10.3l1.2-1.2 2.1 2.1 5-5 1.2 1.2z'/%3E%3C/svg%3E")
    center/13px no-repeat;
}
.servicio .btn { margin-top: auto; }

/* Lista de comprobación */
.checks { display: grid; gap: 16px; }
.checks li { position: relative; padding-left: 40px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 2px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--sol-suave)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23B8431A'%3E%3Cpath d='M8.2 13.6 4.9 10.3l1.2-1.2 2.1 2.1 5-5 1.2 1.2z'/%3E%3C/svg%3E")
    center/17px no-repeat;
}
.checks strong { display: block; color: var(--mar); font-weight: 600; }
.checks span { color: var(--tinta-suave); font-size: .95rem; }

/* Cifra destacada */
.cifra__valor {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3rem); color: var(--sol);
  line-height: 1;
}
.cifra__texto { font-size: .92rem; color: var(--tinta-suave); margin-top: 8px; }
.seccion--oscura .cifra__texto { color: rgba(255,255,255,.66); }

/* ---------------------------------------------------------------------------
   FORMULARIOS
   ------------------------------------------------------------------------ */
.campo { margin-bottom: 16px; }
.campo__etiqueta {
  display: block; font-size: .86rem; font-weight: 600;
  color: var(--mar); margin-bottom: 7px;
}
.campo__control {
  width: 100%; min-height: 54px;
  padding: 14px 16px;
  background: var(--papel);
  border: 1.5px solid var(--linea);
  border-radius: var(--r-s);
  font-size: 1rem;
  transition: border-color .18s var(--easing), box-shadow .18s var(--easing);
  appearance: none;
}
.campo__control::placeholder { color: #9AA5AA; }
.campo__control:hover { border-color: #CBBFAF; }
.campo__control:focus {
  outline: none; border-color: var(--sol);
  box-shadow: 0 0 0 3px rgba(228, 98, 46, .18);
}
.campo__control[aria-invalid="true"] { border-color: #C0341D; }
textarea.campo__control { min-height: 120px; resize: vertical; }
select.campo__control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%235A6B72'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 20px;
  padding-right: 44px; cursor: pointer;
}
.campo__error {
  margin: 7px 0 0; font-size: .84rem; font-weight: 500; color: #C0341D;
}
.campo__error:empty { margin: 0; }

.fila { display: grid; gap: 16px; }
@media (min-width: 560px) { .fila--2 { grid-template-columns: 1fr 1fr; } }

/* Opciones tipo tarjeta seleccionable */
.opciones { display: grid; gap: 12px; }
@media (min-width: 560px) { .opciones--2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 720px) { .opciones--3 { grid-template-columns: repeat(3, 1fr); } }

.opcion { display: block; cursor: pointer; }
.opcion input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opcion__caja {
  display: flex; flex-direction: column; gap: 4px;
  height: 100%; padding: 18px 18px 16px;
  background: var(--papel);
  border: 1.5px solid var(--linea);
  border-radius: var(--r-m);
  transition: border-color .18s var(--easing), background-color .18s var(--easing), box-shadow .18s var(--easing);
}
.opcion:hover .opcion__caja { border-color: #CBBFAF; background: var(--sol-suave); }
.opcion input:checked + .opcion__caja {
  border-color: var(--sol); background: var(--sol-suave);
  box-shadow: 0 0 0 3px rgba(228, 98, 46, .16);
}
.opcion input:focus-visible + .opcion__caja { outline: 3px solid var(--sol); outline-offset: 2px; }
.opcion__titulo { font-weight: 600; color: var(--mar); }
.opcion__nota { font-size: .85rem; color: var(--tinta-suave); }

/* Consentimiento */
.consentimiento {
  display: grid; grid-template-columns: auto 1fr; gap: 12px;
  align-items: start; margin-top: 18px;
  font-size: .84rem; color: var(--tinta-suave); line-height: 1.55;
  cursor: pointer;
}
.consentimiento input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--sol); cursor: pointer; }
.consentimiento a { color: var(--mar); text-decoration: underline; text-underline-offset: 2px; }

.microtexto { font-size: .8rem; color: var(--tinta-suave); margin-top: 14px; }

/* Trampa antispam: invisible para personas */
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------------------------
   BOTÓN FLOTANTE DE WHATSAPP
   ------------------------------------------------------------------------ */
.wa-flotante {
  position: fixed; right: 20px; bottom: 20px; z-index: 70;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--wa); color: #fff;
  display: grid; place-content: center;
  box-shadow: 0 10px 26px rgba(37, 211, 102, .42);
  transition: transform .2s var(--easing);
}
.wa-flotante:hover { transform: scale(1.06); }
.wa-flotante svg { width: 30px; height: 30px; }

/* ---------------------------------------------------------------------------
   PIE
   ------------------------------------------------------------------------ */
.pie { background: var(--mar); color: rgba(255,255,255,.72); padding: 64px 0 28px; font-size: .93rem; }
.pie a { transition: color .18s var(--easing); }
.pie a:hover { color: #fff; }
.pie__grid { display: grid; gap: 34px; }
@media (min-width: 640px) { .pie__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .pie__grid { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 42px; } }
.pie .marca__texto { color: #fff; }
.pie__desc { max-width: 34ch; margin-top: 14px; }
.pie__titulo {
  font-family: var(--texto); font-size: .78rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.5); margin-bottom: 14px;
}
.pie__lista { display: grid; gap: 10px; }
.pie__bajo {
  margin-top: 44px; padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: .82rem; color: rgba(255,255,255,.5);
}

/* ---------------------------------------------------------------------------
   ANIMACIÓN DE ENTRADA
   ------------------------------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--easing), transform .6s var(--easing); }
.reveal.is-visible { opacity: 1; transform: none; }
