/* ============================================================
   PROSEYCO — components.css
   Componentes compartidos: fondo, header/nav, hero, botones,
   paneles, cards, CTA, footer, WhatsApp float, badges.
   Capa de @layer components
   ============================================================ */

@layer components {

  /* ================= BACKGROUND ================= */
  .bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background:
      radial-gradient(70% 60% at 5% 0%, rgba(96, 125, 160, 0.20), transparent 65%),
      radial-gradient(55% 60% at 100% 100%, rgba(238, 116, 101, 0.09), transparent 65%),
      var(--blue-950);
  }
  .halftone-field {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0.42;
    pointer-events: none;
    mix-blend-mode: screen;
  }
  .bg .halftone {
    position: absolute;
    inset: -10%;
    background-image: radial-gradient(rgba(201, 213, 227, 0.42) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.08;
    animation: driftDots 40s linear infinite;
  }
  .bg .blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.28;
    mix-blend-mode: screen;
  }
  .bg .blob-a { width: 48vmax; height: 48vmax; background: var(--blue-700);  top: -20vmax; left: -16vmax; animation: floatA 26s ease-in-out infinite; }
  .bg .blob-b { width: 36vmax; height: 36vmax; background: var(--coral);   bottom: -18vmax; right: -12vmax; opacity: 0.13; animation: floatB 30s ease-in-out infinite; }
  .bg .blob-c { width: 28vmax; height: 28vmax; background: #91a9c3;        top: 38%; left: 62%; opacity: 0.12; animation: floatC 34s ease-in-out infinite; }

  @keyframes driftDots { 0% { transform: translate(0, 0); } 100% { transform: translate(-30px, -30px); } }
  @keyframes floatA { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(5vmax, 7vmax) scale(1.06); } }
  @keyframes floatB { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-5vmax, -4vmax) scale(1.08); } }
  @keyframes floatC { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-4vmax, 5vmax); } }

  /* ================= HEADER / NAV ================= */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    padding: 30px var(--safe-x);
    background-color: transparent;
    border-bottom: 1px solid transparent;
    transition: background-color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  }
  .site-header.is-scrolled {
    background-color: rgba(16, 28, 49, 0.85);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(3, 10, 23, 0.25);
  }
  .site-header__inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
  .logo { display: flex; align-items: center; min-width: 0; }
  .logo img { height: 34px; width: auto; }
  .logo-sub {
    font-family: var(--font-body);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.19em;
    color: var(--blue-200);
    display: block;
    margin-top: 7px;
  }
  .logo--ink .logo-sub { color: var(--ink-soft); }

  .nav {
    display: flex;
    align-items: center;
    gap: 22px;
  }
  .nav-link {
    position: relative;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    color: var(--blue-100);
    text-decoration: none;
    transition: color 0.25s ease;
  }
  .nav-link:hover {
    color: var(--coral);
  }
  .nav-link.is-active {
    color: var(--white);
  }
  .nav-link.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 3px;
    background: var(--coral);
    border-radius: 3px;
  }

  .nav-cta {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    background: var(--coral);
    padding: 11px 20px;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 22px rgba(160, 55, 45, 0.28);
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  }
  .nav-cta:hover { transform: translateY(-2px); background: var(--coral-dark); box-shadow: 0 12px 28px rgba(160, 55, 45, 0.36); }

  /* Nav móvil */
  .nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
  }
  .nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ================= BOTONES ================= */
  .btn {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 999px;
    padding: 15px 23px;
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  }
  .btn-primary {
    color: var(--ink);
    background: var(--white);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.20);
  }
  .btn-primary:hover { transform: translateY(-3px); box-shadow: 0 20px 42px rgba(0, 0, 0, 0.27); }
  .btn-ghost {
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.05);
  }
  .btn-ghost:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.38); }
  .btn-coral {
    color: var(--white);
    background: var(--coral);
    box-shadow: 0 14px 35px rgba(160, 55, 45, 0.28);
  }
  .btn-coral:hover { transform: translateY(-3px); background: var(--coral-dark); }

  /* ================= EYEBROW / HEADINGS ================= */
  .eyebrow {
    font-family: var(--font-kicker);
    font-size: clamp(17px, 2vw, 22px);
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0;
    color: #d9e2ec;
    text-transform: none;
    margin-bottom: 18px;
  }
  .eyebrow--coral { color: var(--coral); }

  .h-display {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: -0.055em;
    color: var(--white);
  }
  .h-display--xl { font-size: clamp(42px, 6vw, 82px); }
  .h-display--hero { font-size: clamp(58px, 9vw, 112px); }

  /* ================= CARD GENÉRICA (panel) ================= */
  .panel {
    position: relative;
    min-height: 360px;
    padding: 30px 28px 28px;
    color: var(--ink);
    text-align: left;
    overflow: hidden;
    border: 1px solid rgba(16, 23, 34, 0.10);
    border-radius: var(--radius-md);
    background: rgba(248, 249, 248, 0.96);
    box-shadow: var(--shadow-card);
    transition: transform 0.45s var(--ease-out), box-shadow 0.35s ease;
  }
  .panel:hover {
    transform: translateY(-12px);
    box-shadow: 0 35px 75px rgba(3, 12, 27, 0.32);
  }
  .panel .dots {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 145px;
    height: 145px;
    background-image: radial-gradient(var(--blue-500) 1.5px, transparent 1.5px);
    background-size: 10px 10px;
    opacity: 0.16;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
  }
  .panel > *:not(.dots) { position: relative; z-index: 1; }
  .panel .num {
    font-size: 10px;
    letter-spacing: 0.13em;
    color: var(--coral-dark);
    font-weight: 700;
  }
  .panel .icon { width: 48px; height: 48px; margin: 30px 0 22px; }
  .panel h3 {
    font-size: clamp(20px, 1.65vw, 25px);
    line-height: 1.02;
    letter-spacing: -0.035em;
    margin-bottom: 13px;
    color: var(--ink);
  }
  .panel p { font-size: 13px; line-height: 1.65; color: var(--ink-soft); }
  .panel .kpi {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 22px;
    font-size: 10px;
    font-weight: 700;
    color: var(--white);
    background: var(--blue-800);
    padding: 7px 10px;
    border-radius: 999px;
  }

  /* ================= CTA BANNER ================= */
  .cta-banner {
    width: min(100% - 2 * var(--safe-x), var(--content-max));
    margin: clamp(80px, 10vw, 140px) auto;
    padding: clamp(48px, 6vw, 80px);
    border-radius: var(--radius-lg);
    background:
      linear-gradient(120deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
      rgba(20, 38, 63, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: var(--shadow-card-lg);
    backdrop-filter: blur(22px);
    text-align: center;
    overflow: hidden;
    position: relative;
  }
  .cta-banner::before {
    content: "";
    position: absolute;
    width: 420px; height: 420px;
    right: -150px; top: -180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(238, 116, 101, 0.20), transparent 68%);
  }
  .cta-banner h2 {
    font-size: clamp(30px, 4.5vw, 54px);
    color: var(--white);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 16px;
  }
  .cta-banner p { color: #dbe3ec; max-width: 580px; margin: 0 auto 28px; font-size: 15px; }
  .cta-banner__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

  /* ================= FOOTER ================= */
  .site-footer {
    position: relative;
    z-index: 2; /* por encima del fondo fijo (.bg z-index:0) */
    text-align: left;
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(60px, 8vw, 110px) var(--safe-x) 80px;
  }
  .site-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  .site-footer h4 {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--blue-200);
    margin-bottom: 16px;
  }
  .site-footer a {
    display: block;
    color: var(--blue-100);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 10px;
    transition: color 0.2s ease;
  }
  .site-footer a:hover { color: var(--white); }
  .site-footer .contact-line { color: #c8d4e1; font-size: 14px; line-height: 1.9; }
  .site-footer .contact-line a { display: inline; color: var(--white); border-bottom: 1px solid rgba(255, 255, 255, 0.35); }
  .site-footer .legal {
    margin-top: 24px;
    font-size: 11px;
    color: #7f91a7;
  }

  /* ================= WHATSAPP FLOAT ================= */
  .wa-float {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
  }
  .wa-tooltip {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    background: var(--white);
    padding: 10px 14px;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
  }
  .wa-float:hover .wa-tooltip { opacity: 1; transform: translateX(0); }
  .wa-btn {
    position: relative; /* para que el anillo ::before quede centrado en el botón */
    width: 58px; height: 58px;
    border-radius: 50%;
    background: var(--coral);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 35px rgba(160, 55, 45, 0.32);
    flex: none;
    transition: transform 0.25s ease;
  }
  .wa-float:hover .wa-btn { transform: translateY(-3px); }
  .wa-btn svg { width: 27px; height: 27px; }
  .wa-btn::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 1px solid rgba(238, 116, 101, 0.7);
    animation: pulseRing 2.8s ease-out infinite;
  }
  @keyframes pulseRing { 0% { transform: scale(1); opacity: 0.6; } 100% { transform: scale(1.5); opacity: 0; } }

  /* ================= RESPONSIVE componentes ================= */
  @media (max-width: 900px) {
    .nav {
      position: fixed;
      inset: 0;
      z-index: 40;
      background: var(--blue-950);
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 28px;
      transform: translateX(100%);
      transition: transform 0.35s var(--ease-out);
    }
    .nav.is-open { transform: translateX(0); }
    body.nav-open { overflow: hidden; }
    body.nav-open .site-header { position: fixed; top: 0; left: 0; right: 0; width: 100%; }
    .nav-link { font-size: 20px; }
    .nav-toggle { display: flex; }
    .logo, .nav-toggle { position: relative; z-index: 45; }
    .site-footer__grid { grid-template-columns: 1fr; gap: 28px; }

    /* backdrop-filter crea containing block y rompe el .nav fixed → sin blur en móvil */
    .site-header.is-scrolled {
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
      background-color: var(--blue-950);
    }
  }

  @media (max-width: 500px) {
    .wa-tooltip { display: none; }
    .wa-btn { width: 54px; height: 54px; }
  }
}
