/* ============================================================
   GENUS — MOBILE MENU COMPACTO (solo móvil)
   Panel lateral chico y prolijo — no fullscreen.
   ============================================================ */

:root {
  --mnav-aqua: #169ab0;
  --mnav-navy: #07172f;
  --mnav-border: #e8ecef;
  --mnav-surface: #f4f9fa;
  --mnav-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --mnav-w: min(300px, 86vw);
  --mnav-z-overlay: 9998;
  --mnav-z-panel: 9999;
}

.g-mnav-overlay,
.g-mnav {
  display: none;
}

@media (max-width: 900px) {
  .g-nav-links,
  .g-nav-links.open {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .hn-links,
  .hn-links.open {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .g-mnav-overlay,
  .g-mnav {
    display: block;
  }

  body.mnav-open .hn-right,
  body.mnav-open .g-nav-actions {
    display: none !important;
  }

  /* Overlay */
  .g-mnav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 23, 47, 0.28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: var(--mnav-z-overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s var(--mnav-ease);
  }

  body.mnav-open .g-mnav-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  body.mnav-open {
    overflow: hidden;
    touch-action: none;
  }

  /* Panel lateral compacto */
  .g-mnav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--mnav-w);
    z-index: var(--mnav-z-panel);
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s var(--mnav-ease);
    box-shadow: -4px 0 24px rgba(7, 23, 47, 0.1);
    border-left: 1px solid var(--mnav-border);
    overflow: hidden;
  }

  body.mnav-open .g-mnav {
    transform: translateX(0);
  }

  /* Header compacto */
  .g-mnav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    flex-shrink: 0;
    border-bottom: 1px solid var(--mnav-border);
    min-height: 52px;
  }

  .g-mnav-logo img {
    height: 32px;
    width: auto;
    display: block;
  }

  .g-mnav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: var(--mnav-surface);
    color: var(--mnav-navy);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s var(--mnav-ease);
    -webkit-tap-highlight-color: transparent;
  }

  .g-mnav-close:hover,
  .g-mnav-close:focus-visible {
    background: #e4f2f5;
    outline: none;
    box-shadow: 0 0 0 2px rgba(22, 154, 176, 0.2);
  }

  .g-mnav-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
  }

  /* Scroll */
  .g-mnav-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 14px 14px 10px;
  }

  /* CTA compacto */
  .g-mnav-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: 8px;
    background: linear-gradient(180deg, #1aadc2 0%, #169ab0 100%);
    color: #fff !important;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(22, 154, 176, 0.2);
    border: none;
    transition: opacity 0.18s var(--mnav-ease);
    -webkit-tap-highlight-color: transparent;
  }

  .g-mnav-cta:active {
    opacity: 0.92;
  }

  .g-mnav-cta:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(22, 154, 176, 0.35);
  }

  /* Links */
  .g-mnav-links {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
  }

  .g-mnav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 6px;
    color: var(--mnav-navy) !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(232, 236, 239, 0.85);
    transition: background 0.15s var(--mnav-ease), color 0.15s var(--mnav-ease);
    -webkit-tap-highlight-color: transparent;
  }

  .g-mnav-link:last-child {
    border-bottom: none;
  }

  .g-mnav-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--mnav-surface);
    flex-shrink: 0;
    color: var(--mnav-aqua);
  }

  .g-mnav-link-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 1.75;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .g-mnav-link.is-active {
    color: var(--mnav-aqua) !important;
    background: rgba(22, 154, 176, 0.06);
    margin: 0 -6px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 8px;
    border-bottom-color: transparent;
  }

  .g-mnav-link.is-active + .g-mnav-link {
    border-top: none;
  }

  .g-mnav-link:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(22, 154, 176, 0.2);
    border-radius: 8px;
  }

  /* Cards compactas */
  .g-mnav-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    text-decoration: none !important;
    transition: background 0.15s var(--mnav-ease);
    -webkit-tap-highlight-color: transparent;
  }

  .g-mnav-card--product {
    background: #eef7f9;
    border: 1px solid rgba(22, 154, 176, 0.14);
  }

  .g-mnav-card--wa {
    background: #fff;
    border: 1px solid var(--mnav-border);
    box-shadow: 0 1px 4px rgba(7, 23, 47, 0.04);
  }

  .g-mnav-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .g-mnav-card--product .g-mnav-card-icon {
    background: rgba(22, 154, 176, 0.1);
    color: var(--mnav-aqua);
  }

  .g-mnav-card--product .g-mnav-card-icon svg {
    width: 16px;
    height: 16px;
  }

  .g-mnav-card--wa .g-mnav-card-icon {
    background: #e8f9ef;
    color: #25d366;
  }

  .g-mnav-card--wa .g-mnav-card-icon svg {
    width: 18px;
    height: 18px;
  }

  .g-mnav-card-body {
    flex: 1;
    min-width: 0;
  }

  .g-mnav-card-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--mnav-navy);
    line-height: 1.25;
  }

  .g-mnav-badge {
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.05em;
    padding: 2px 5px;
    border-radius: 3px;
    background: var(--mnav-aqua);
    color: #fff;
    line-height: 1.3;
  }

  .g-mnav-card-desc {
    font-size: 11px;
    color: #6d7f8c;
    line-height: 1.35;
    margin-top: 2px;
    font-weight: 500;
  }

  .g-mnav-card-arrow {
    flex-shrink: 0;
    color: #b8c5ce;
    line-height: 0;
  }

  .g-mnav-card-arrow svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
  }

  .g-mnav-card:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(22, 154, 176, 0.2);
  }

  /* Footer mínimo */
  .g-mnav-footer {
    flex-shrink: 0;
    padding: 10px 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--mnav-border);
    text-align: center;
    background: #fafbfc;
  }

  .g-mnav-footer p {
    margin: 0;
    font-size: 10px;
    color: #9aa8b4;
    line-height: 1.4;
  }

  .g-mnav-footer p + p {
    margin-top: 1px;
  }

  /* Hamburguesa oculta con menú abierto */
  body.mnav-open .hn-ham,
  body.mnav-open .g-nav-hamburger {
    opacity: 0;
    pointer-events: none;
  }

  .hn-ham,
  .g-nav-hamburger {
    z-index: calc(var(--mnav-z-panel) + 1);
  }

  /* Creamy oculto */
  body.mnav-open #creamy-v2 .cv2-fab,
  body.mnav-open #creamy-v2 .cv2-greeting,
  body.mnav-open #creamy-v2 .cv2-window {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.25s var(--mnav-ease) !important;
  }

  #creamy-v2 .cv2-fab,
  #creamy-v2 .cv2-greeting {
    transition: opacity 0.3s var(--mnav-ease) !important;
  }
}

@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .g-mnav,
  .g-mnav-overlay {
    transition: none;
  }
}
