/* ============================================================
   EcoCicle Products — styles-mobile.css (V11)
   ============================================================
   EXCLUSIVO para la navegación móvil.
   No afecta ninguna regla de styles.css (desktop).

   Todo lo que está aquí vive dentro de
   @media (max-width: 720px) — invisible en desktop.

   ESTRUCTURA:
   1. Ocultar elementos desktop en móvil
   2. Botón Hamburger
   3. Panel deslizante #mobile-menu
   4. Fila Dark Mode dentro del panel
   5. Links directos
   6. Acordeón (grupos Comercial / Recursos)
   7. CTA verde
   8. Dark Mode overrides
   ============================================================ */


/* ─────────────────────────────────────────────
   FUERA de media query:
   El hamburger y el panel son invisibles e
   inaccesibles en desktop por defecto.
   ───────────────────────────────────────────── */

#hamburger {
  display: none;
  pointer-events: none;
}

#mobile-menu {
  pointer-events: none;
  transform: translateX(100%);
  visibility: hidden;
}


/* ─────────────────────────────────────────────
   TODO LO SIGUIENTE ES SOLO MÓVIL
   ───────────────────────────────────────────── */
@media (max-width: 720px) {

  /* ── 1. Ocultar elementos desktop en móvil ── */
  .menu    { display: none !important; }
  .cta-btn { display: none !important; }


  /* ── 2. Botón Hamburger ── */
  #hamburger {
    display: flex;
    pointer-events: auto;
    position: fixed;
    top: 18px;
    right: 16px;
    z-index: 200;

    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;

    width: 44px;
    height: 44px;
    padding: 10px;

    background: rgba(10, 47, 102, .07);
    border: 1px solid rgba(10, 47, 102, .14);
    border-radius: 12px;
    cursor: pointer;
    transition: background .2s ease;
  }

  #hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #0a2f66;
    border-radius: 2px;
    transition:
      transform .28s cubic-bezier(.4, 0, .2, 1),
      opacity   .28s cubic-bezier(.4, 0, .2, 1);
    transform-origin: center;
  }

  /* Hamburger → X cuando está abierto */
  #hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  #hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  #hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


  /* ── 3. Panel deslizante ── */
  #mobile-menu {
    /* Posición: cubre toda la pantalla desde arriba */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 190;             /* debajo del hamburger (200) */

    /* Layout interno */
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 80px 16px 32px;  /* 80px arriba = espacio para el hamburger */
    overflow-y: auto;

    /* Apariencia */
    background: #ffffff;

    /* Estado cerrado */
    pointer-events: none;
    visibility: hidden;
    transform: translateX(100%);
    transition:
      transform  .3s cubic-bezier(.4, 0, .2, 1),
      visibility .3s;
  }

  /* Estado abierto */
  #mobile-menu.open {
    pointer-events: auto;
    visibility: visible;
    transform: translateX(0);
  }


  /* ── 4. Fila Dark Mode ── */
  .mob-dm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 4px;
  }

  .mob-dm-label {
    font-size: 14px;
    font-weight: 700;
    color: #314a6c;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  }

  #dm-pill-mobile {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #b8cde0;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .25s ease;
  }

  #dm-pill-mobile::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
    transition: transform .25s ease;
  }

  #dm-pill-mobile.on               { background: #1a3a6b; }
  #dm-pill-mobile.on::after        { transform: translateX(20px); }

  .mob-divider {
    height: 1px;
    background: rgba(10, 47, 102, .08);
    margin: 4px 0 8px;
  }


  /* ── 5. Links directos ── */
  #mobile-menu > a {
    display: block;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #1a3a6b;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    transition: background .15s ease, color .15s ease;
  }

  #mobile-menu > a:hover,
  #mobile-menu > a.active {
    background: rgba(10, 47, 102, .06);
    color: #0a2f66;
  }


  /* ── 6. Acordeón ── */
  .mob-group {
    display: flex;
    flex-direction: column;
  }

  .mob-group-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 700;
    color: #1a3a6b;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    cursor: pointer;
    text-align: left;
    transition: background .15s ease;
  }

  .mob-group-btn:hover {
    background: rgba(10, 47, 102, .06);
  }

  .mob-caret {
    font-size: 12px;
    opacity: .6;
    flex-shrink: 0;
    transition: transform .22s ease;
  }

  .mob-group-btn[aria-expanded="true"] .mob-caret {
    transform: rotate(180deg);
  }

  /* Panel del acordeón — cerrado por defecto */
  .mob-group-panel {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 12px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .28s cubic-bezier(.4, 0, .2, 1);
  }

  .mob-group-panel.open {
    max-height: 300px;
  }

  .mob-group-panel a {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #3a5a8c;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    transition: background .15s ease, color .15s ease;
  }

  .mob-group-panel a:hover {
    background: rgba(10, 47, 102, .05);
    color: #0a2f66;
  }


  /* ── 7. CTA verde ── */
  .mob-cta {
    display: block;
    margin-top: 12px;
    padding: 16px 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #78b536, #30c55a);
    color: #fff !important;
    font-size: 15px;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 10px 24px rgba(120, 181, 54, .28);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    transition: opacity .2s ease;
  }

  .mob-cta:hover { opacity: .88; }


  /* ── 8. Dark Mode overrides ── */
  body.dark-mode #hamburger {
    background: rgba(255, 255, 255, .07) !important;
    border-color: rgba(255, 255, 255, .14) !important;
  }

  body.dark-mode #hamburger span {
    background: #c5d8f0 !important;
  }

  body.dark-mode #mobile-menu {
    background: #0d1b2e !important;
  }

  body.dark-mode .mob-dm-label {
    color: #c5d8f0 !important;
  }

  body.dark-mode .mob-divider {
    background: rgba(255, 255, 255, .08) !important;
  }

  body.dark-mode #mobile-menu > a {
    color: #c5d8f0 !important;
  }

  body.dark-mode #mobile-menu > a:hover,
  body.dark-mode #mobile-menu > a.active {
    background: rgba(255, 255, 255, .06) !important;
    color: #fff !important;
  }

  body.dark-mode .mob-group-btn {
    color: #c5d8f0 !important;
  }

  body.dark-mode .mob-group-btn:hover {
    background: rgba(255, 255, 255, .06) !important;
  }

  body.dark-mode .mob-group-panel a {
    color: #97b8d8 !important;
  }

  body.dark-mode .mob-group-panel a:hover {
    background: rgba(255, 255, 255, .05) !important;
    color: #fff !important;
  }

} /* fin @media (max-width: 720px) */
