﻿    /* ===== Encabezado MediSel (clases con prefijo .ms-hd para no chocar con el sitio) ===== */
  .ms-hd {
    --ms-green: #5aaa14;
    --ms-green-dark: #3f7f0a;
    --ms-green-ink: #1f6b2a;
    --ms-purple: #a04ba3;
    --ms-purple-dark: #6d3f8c;
    --ms-ink: #1d2b36;
    --ms-muted: #5f6b75;
    --ms-line: rgba(29,43,54,.08);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    position: sticky; top: 0; z-index: 1000;
  }
  .ms-hd *, .ms-hd *::before, .ms-hd *::after { box-sizing: border-box; }
  .ms-hd a { text-decoration: none; }
  .ms-hd__wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

  /* ---------- Barra de contacto ---------- */
  .ms-hd__top {
    background: linear-gradient(90deg, var(--ms-purple-dark), var(--ms-purple));
    color: #fff; font-size: 13.5px;
    transition: margin-top .3s ease;
  }
  .ms-hd__top .ms-hd__wrap {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 40px;
  }
  .ms-hd__tagline { display: flex; align-items: center; gap: 8px; opacity: .95; }
  .ms-hd__tagline svg { color: #c8f59a; }
  .ms-hd__contacts { display: flex; align-items: center; gap: 22px; }
  .ms-hd__contact {
    display: inline-flex; align-items: center; gap: 7px; color: #fff; opacity: .92;
    transition: opacity .2s ease;
  }
  .ms-hd__contact:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
  .ms-hd__contact svg { flex: 0 0 15px; }
  .ms-hd__contact-label { opacity: .75; }

  /* ---------- Barra principal ---------- */
  .ms-hd__main {
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--ms-line);
    transition: box-shadow .3s ease;
  }
  .ms-hd.is-scrolled .ms-hd__main { box-shadow: 0 10px 30px -18px rgba(29,43,54,.45); }
  .ms-hd__main .ms-hd__wrap {
    display: flex; align-items: center; justify-content: space-between; height: 84px;
    transition: height .3s ease;
  }
  .ms-hd.is-scrolled .ms-hd__main .ms-hd__wrap { height: 68px; }

  /* Logo */
  .ms-hd__logo { display: inline-flex; align-items: center; gap: 10px; }
  .ms-hd__logo-icon { width: 52px; height: 52px; transition: width .3s ease, height .3s ease; }
  .ms-hd.is-scrolled .ms-hd__logo-icon { width: 44px; height: 44px; }
  .ms-hd__logo-text {
    font-family: Calibri, Carlito, 'Segoe UI', 'Inter', sans-serif;
    font-size: 40px; line-height: 1; color: var(--ms-purple); letter-spacing: -.5px;
    transition: font-size .3s ease;
  }
  .ms-hd.is-scrolled .ms-hd__logo-text { font-size: 34px; }
  .ms-hd__logo img { height: 56px; width: auto; display: block; }

  /* Navegación */
  .ms-hd__nav { display: flex; align-items: center; gap: 6px; }
  .ms-hd__link {
    position: relative; color: var(--ms-ink); font-weight: 500; font-size: 15.5px;
    padding: 10px 16px; border-radius: 10px;
    transition: color .2s ease, background .2s ease;
  }
  .ms-hd__link::after {
    content: ""; position: absolute; left: 16px; right: 16px; bottom: 4px; height: 2px;
    background: var(--ms-green); border-radius: 2px;
    transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
  }
  .ms-hd__link:hover { color: var(--ms-green-ink); background: rgba(90,170,20,.08); }
  .ms-hd__link:hover::after, .ms-hd__link[aria-current="page"]::after { transform: scaleX(1); }
  .ms-hd__link[aria-current="page"] { color: var(--ms-green-ink); }

  .ms-hd__cta {
    display: inline-flex; align-items: center; gap: 8px; margin-left: 14px;
    background: linear-gradient(135deg, var(--ms-purple), var(--ms-purple-dark));
    color: #fff; font-weight: 600; font-size: 15px; letter-spacing: .04em;
    padding: 12px 22px; border-radius: 12px;
    box-shadow: 0 10px 20px -10px rgba(109,63,140,.8);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  }
  .ms-hd__cta:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 14px 24px -10px rgba(109,63,140,.9); }
  .ms-hd__cta:focus-visible, .ms-hd__link:focus-visible, .ms-hd__burger:focus-visible {
    outline: 3px solid var(--ms-green); outline-offset: 2px;
  }

  /* Botón menú móvil */
  .ms-hd__burger {
    display: none; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--ms-line);
    background: #fff; cursor: pointer; align-items: center; justify-content: center; padding: 0;
  }
  .ms-hd__burger span, .ms-hd__burger span::before, .ms-hd__burger span::after {
    display: block; width: 20px; height: 2px; background: var(--ms-purple-dark); border-radius: 2px;
    position: relative; transition: transform .25s ease, background .25s ease;
  }
  .ms-hd__burger span::before, .ms-hd__burger span::after { content: ""; position: absolute; left: 0; }
  .ms-hd__burger span::before { top: -6px; }
  .ms-hd__burger span::after  { top: 6px; }
  .ms-hd.is-open .ms-hd__burger span { background: transparent; }
  .ms-hd.is-open .ms-hd__burger span::before { transform: translateY(6px) rotate(45deg); }
  .ms-hd.is-open .ms-hd__burger span::after  { transform: translateY(-6px) rotate(-45deg); }

  .ms-hd__mobile-contacts { display: none; }

  /* ---------- Responsive ---------- */
  @media (max-width: 1024px) {
    .ms-hd__tagline { display: none; }
    .ms-hd__top .ms-hd__wrap { justify-content: center; }
  }
  @media (max-width: 860px) {
    .ms-hd__top { display: none; }
    .ms-hd__burger { display: inline-flex; }
    .ms-hd__main .ms-hd__wrap { height: 72px; }
    .ms-hd__logo-icon { width: 44px; height: 44px; }
    .ms-hd__logo-text { font-size: 34px; }

    .ms-hd__nav {
      position: absolute; left: 0; right: 0; top: 100%;
      flex-direction: column; align-items: stretch; gap: 4px;
      background: #fff; padding: 12px 20px 22px;
      border-bottom: 1px solid var(--ms-line);
      box-shadow: 0 20px 30px -20px rgba(29,43,54,.4);
      opacity: 0; visibility: hidden; transform: translateY(-8px);
      transition: opacity .25s ease, transform .25s ease, visibility .25s;
    }
    .ms-hd.is-open .ms-hd__nav { opacity: 1; visibility: visible; transform: none; }
    .ms-hd__main { position: relative; }
    .ms-hd__link { font-size: 17px; padding: 14px 12px; }
    .ms-hd__link::after { display: none; }
    .ms-hd__cta { margin: 10px 0 0; justify-content: center; padding: 14px; }

    .ms-hd__mobile-contacts {
      display: grid; gap: 4px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--ms-line);
    }
    .ms-hd__mobile-contacts .ms-hd__contact { color: var(--ms-ink); opacity: 1; padding: 8px 4px; font-size: 15px; }
    .ms-hd__mobile-contacts .ms-hd__contact svg { color: var(--ms-green-dark); }
    .ms-hd__mobile-contacts .ms-hd__contact-label { color: var(--ms-muted); opacity: 1; }
  }
  @media (prefers-reduced-motion: reduce) {
    .ms-hd * { transition: none !important; }
  }