
  /* =========================================================
  VARIABLES
  ========================================================== */

  :root {
    --cp-header-bg: rgba(255, 255, 255, 0.72);
    --cp-header-bg-scroll: rgba(255, 255, 255, 0.94);
    --cp-header-border: rgba(10, 49, 93, 0.10);

    --cp-blue: #1299d6;
    --cp-blue-light: #39c3f2;
    --cp-white: #ffffff;
    --cp-navy: #0c2f63;
    --cp-text-soft: rgba(12, 47, 99, 0.72);

    --cp-green: #16bf5b;
    --cp-green-hover: #0eaa4d;

    --cp-container: 1280px;
    --cp-header-height: 82px;
  }

  /* =========================================================
  RESET LOCAL
  ========================================================== */

  .cp-header,
  .cp-header * {
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
    scroll-padding-top: 95px;
  }

  body {
    margin: 0;
  }

  body.cp-menu-open {
    overflow: hidden;
  }

  /* =========================================================
  HEADER
  ========================================================== */

  .cp-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;

    background:
      linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.86) 0%,
        rgba(245, 251, 255, 0.76) 52%,
        rgba(255, 255, 255, 0.84) 100%
      );

    border-bottom: 1px solid var(--cp-header-border);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    transition:
      background 0.3s ease,
      box-shadow 0.3s ease;
  }

  .cp-header.is-scrolled {
    background: var(--cp-header-bg-scroll);
    box-shadow: 0 12px 32px rgba(8, 43, 84, 0.14);
  }

  .cp-header__container {
    width: min(calc(100% - 48px), var(--cp-container));
    min-height: var(--cp-header-height);
    margin: 0 auto;

    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 34px;
  }

  /* =========================================================
  LOGO
  ========================================================== */

  .cp-header__logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;

    text-decoration: none;
    color: var(--cp-white);

    flex-shrink: 0;
  }

  .cp-header__logo-img {
    display: block;
    width: 206px;
    height: auto;
    max-width: 206px;
    object-fit: contain;
  }

  /* =========================================================
  NAVEGACIÓN DESKTOP
  ========================================================== */

  .cp-header__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
  }

  .cp-header__link {
    position: relative;

    display: inline-flex;
    align-items: center;

    min-height: var(--cp-header-height);

    font-family: Arial, Helvetica, sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1;

    text-decoration: none;
    color: var(--cp-text-soft);

    transition:
      color 0.25s ease,
      transform 0.25s ease;
  }

  .cp-header__link::after {
    content: "";

    position: absolute;
    left: 50%;
    bottom: 16px;

    width: 0;
    height: 2px;

    border-radius: 20px;

    background:
      linear-gradient(
        90deg,
        var(--cp-blue),
        var(--cp-blue-light)
      );

    transform: translateX(-50%);

    transition: width 0.25s ease;
  }

  .cp-header__link:hover,
  .cp-header__link.is-active {
    color: var(--cp-navy);
  }

  .cp-header__link:hover::after,
  .cp-header__link.is-active::after {
    width: 32px;
  }

  /* =========================================================
  ACCIONES
  ========================================================== */

  .cp-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
  }

  .cp-header__whatsapp {
    min-height: 44px;
    padding: 0 21px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    border-radius: 9px;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 700;

    text-decoration: none;
    color: var(--cp-white);

    background:
      linear-gradient(
        135deg,
        var(--cp-green) 0%,
        #0db64f 100%
      );

    border: 1px solid rgba(255, 255, 255, 0.15);

    box-shadow:
      0 10px 24px rgba(13, 182, 79, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.18);

    transition:
      transform 0.25s ease,
      box-shadow 0.25s ease,
      background 0.25s ease;
  }

  .cp-header__whatsapp:hover {
    transform: translateY(-2px);

    background:
      linear-gradient(
        135deg,
        #20cc65 0%,
        var(--cp-green-hover) 100%
      );

    box-shadow:
      0 14px 30px rgba(13, 182, 79, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }

  .cp-header__whatsapp-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .cp-header__whatsapp-icon svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  /* =========================================================
  BOTÓN HAMBURGUESA
  ========================================================== */

  .cp-header__toggle {
    width: 46px;
    height: 46px;

    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    gap: 5px;
    padding: 0;

    border: 1px solid rgba(12, 47, 99, 0.14);
    border-radius: 10px;

    background: rgba(12, 47, 99, 0.045);

    cursor: pointer;

    transition:
      background 0.25s ease,
      border-color 0.25s ease;
  }

  .cp-header__toggle:hover {
    background: rgba(12, 47, 99, 0.09);
    border-color: rgba(12, 47, 99, 0.22);
  }

  .cp-header__toggle span {
    width: 21px;
    height: 2px;

    display: block;

    border-radius: 20px;
    background: var(--cp-navy);

    transition:
      transform 0.28s ease,
      opacity 0.28s ease;
  }

  .cp-header__toggle.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .cp-header__toggle.is-active span:nth-child(2) {
    opacity: 0;
  }

  .cp-header__toggle.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* =========================================================
  MENÚ MÓVIL
  ========================================================== */

  .cp-header__mobile {
    max-height: 0;
    overflow: hidden;

    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    opacity: 0;
    visibility: hidden;

    border-top: 1px solid transparent;

    transition:
      max-height 0.35s ease,
      opacity 0.25s ease,
      visibility 0.25s ease,
      border-color 0.25s ease;
  }

  .cp-header__mobile.is-open {
    max-height: calc(100vh - var(--cp-header-height));

    opacity: 1;
    visibility: visible;

    overflow-y: auto;

    border-top-color: rgba(12, 47, 99, 0.10);
  }

  .cp-header__mobile-nav {
    width: min(calc(100% - 36px), 720px);
    margin: 0 auto;
    padding: 18px 0 26px;

    display: flex;
    flex-direction: column;
  }

  .cp-header__mobile-link {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 56px;

    border-bottom: 1px solid rgba(12, 47, 99, 0.08);

    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 600;

    text-decoration: none;
    color: rgba(12, 47, 99, 0.78);

    transition:
      color 0.25s ease,
      padding-left 0.25s ease;
  }

  .cp-header__mobile-link::before {
    content: "";

    width: 0;
    height: 2px;

    margin-right: 0;

    border-radius: 20px;
    background: var(--cp-blue-light);

    transition:
      width 0.25s ease,
      margin-right 0.25s ease;
  }

  .cp-header__mobile-link:hover,
  .cp-header__mobile-link.is-active {
    color: var(--cp-navy);
    padding-left: 2px;
  }

  .cp-header__mobile-link:hover::before,
  .cp-header__mobile-link.is-active::before {
    width: 18px;
    margin-right: 10px;
  }

  .cp-header__mobile-whatsapp {
    min-height: 52px;
    margin-top: 20px;
    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    border-radius: 10px;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 700;

    text-decoration: none;
    color: var(--cp-white);

    background:
      linear-gradient(
        135deg,
        var(--cp-green),
        var(--cp-green-hover)
      );

    box-shadow: 0 12px 28px rgba(13, 182, 79, 0.24);
  }

  .cp-header__mobile-whatsapp span {
    width: 21px;
    height: 21px;
  }

  .cp-header__mobile-whatsapp svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  /* =========================================================
  RESPONSIVE
  ========================================================== */

  @media (max-width: 1120px) {
    .cp-header__container {
      gap: 22px;
    }

    .cp-header__nav {
      gap: 22px;
    }

    .cp-header__link {
      font-size: 13.5px;
    }

    .cp-header__whatsapp {
      padding: 0 17px;
      font-size: 12px;
    }
  }

  @media (max-width: 960px) {
    :root {
      --cp-header-height: 74px;
    }

    .cp-header__container {
      width: min(calc(100% - 32px), var(--cp-container));
      grid-template-columns: 1fr auto;
    }

    .cp-header__nav {
      display: none;
    }

    .cp-header__toggle {
      display: flex;
    }

    .cp-header__logo-img {
      width: 190px;
      height: auto;
      max-width: 190px;
    }
  }

  @media (max-width: 680px) {
    :root {
      --cp-header-height: 70px;
    }

    .cp-header__container {
      width: calc(100% - 26px);
    }

    .cp-header__whatsapp {
      width: 44px;
      min-width: 44px;
      padding: 0;
    }

    .cp-header__whatsapp > span:last-child {
      display: none;
    }

    .cp-header__logo-img {
      width: 170px;
      height: auto;
      max-width: 170px;
    }

    .cp-header__toggle {
      width: 44px;
      height: 44px;
    }

    .cp-header__mobile-link {
      font-size: 16px;
    }
  }

  @media (max-width: 390px) {
    .cp-header__container {
      width: calc(100% - 20px);
      gap: 8px;
    }

    .cp-header__actions {
      gap: 8px;
    }

    .cp-header__logo-img {
      width: 154px;
      height: auto;
      max-width: 154px;
    }
  }

  /* =========================================================
  CORRECCIÓN ELEMENTOR · EDITOR Y VISTA PREVIA
  Mantiene el header visible aunque Elementor vuelva a renderizar.
  ========================================================== */

  body.elementor-editor-active .cp-header,
  body.elementor-editor-preview .cp-header,
  body.elementor-edit-area-active .cp-header,
  html.elementor-html .cp-header,
  .elementor-editor-active .cp-header,
  .elementor-editor-preview .cp-header {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
    z-index: 999999 !important;
  }

  body.elementor-editor-active .cp-header__container,
  body.elementor-editor-preview .cp-header__container,
  body.elementor-edit-area-active .cp-header__container {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

