/* ═══════════════════════════════════════════════════════ */
/*  HAMBURGER MENU — FARMAX                               */
/*  Panel lateral completo para móvil                    */
/* ═══════════════════════════════════════════════════════ */

/* ── Botón hamburguesa (solo visible en móvil) ── */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  border-radius: 10px;
  transition: background .2s;
  flex-shrink: 0;
  z-index: 201;
}
.hamburger-btn:hover { background: rgba(46,168,122,.1); }
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--green-deep, #0d3b2e);
  border-radius: 2px;
  transition: transform .3s cubic-bezier(.23,1,.32,1), opacity .2s, width .3s;
  transform-origin: center;
}

/* Animación X al abrir */
.hamburger-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.is-open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Overlay oscuro detrás del panel ── */
.mob-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,30,20,.5);
  backdrop-filter: blur(2px);
  z-index: 300;
  opacity: 0;
  transition: opacity .3s;
}
.mob-overlay.visible {
  display: block;
  opacity: 1;
}

/* ── Panel lateral ── */
.mob-menu {
  position: fixed;
  top: 0;
  right: -110%;
  width: 290px;
  max-width: 85vw;
  height: 100vh;          /* fallback universal */
  height: 100dvh;         /* dinámico moderno */
  background: #ffffff;
  z-index: 400;
  display: flex;
  flex-direction: column;
  box-shadow: -6px 0 32px rgba(13,59,46,.18);
  transition: right .32s cubic-bezier(.23,1,.32,1);
  overflow: hidden;       /* el panel mismo NO hace scroll */
}
.mob-menu.is-open { right: 0; }

/* ── Cabecera del panel (fija, no crece) ── */
.mob-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(46,168,122,.12);
  background: #0d3b2e;
  flex-shrink: 0;
}
.mob-menu-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mob-menu-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.mob-menu-brand span {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: -.03em;
}
.mob-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  flex-shrink: 0;
}
.mob-close-btn:hover { background: rgba(255,255,255,.2); }

/* ── Sección usuario (fija, no crece) ── */
.mob-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(46,168,122,.07) 0%, transparent 100%);
  border-bottom: 1px solid rgba(46,168,122,.1);
  flex-shrink: 0;
}
.mob-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #d4f0e4;
  border: 1.5px solid rgba(46,168,122,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mob-user-avatar svg { width: 20px; height: 20px; fill: #1a6b4a; }
.mob-user-info { flex: 1; min-width: 0; }
.mob-user-name {
  font-size: .95rem;
  font-weight: 600;
  color: #0d3b2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.mob-user-doc {
  font-size: .75rem;
  color: #5a7a6a;
  margin-top: 1px;
}

/* ── Área scrollable: contiene nav + footer ── */
.mob-scroll-area {
  flex: 1;              /* ocupa el espacio restante */
  overflow-y: auto;     /* scroll solo aquí */
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

/* ── Links de navegación ── */
.mob-nav {
  display: flex;
  flex-direction: column;
  padding: 6px 10px 8px;
  gap: 1px;
}

.mob-nav-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #5a7a6a;
  padding: 10px 8px 4px;
}

.mob-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 10px;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  color: #0d2018;
  transition: background .18s, color .18s;
}
.mob-nav a svg {
  width: 18px;
  height: 18px;
  fill: #5a7a6a;
  flex-shrink: 0;
  transition: fill .18s;
}
.mob-nav a:hover,
.mob-nav a.active-link {
  background: #d4f0e4;
  color: #1a6b4a;
}
.mob-nav a:hover svg,
.mob-nav a.active-link svg { fill: #1a6b4a; }
.mob-nav a.active-link { font-weight: 600; }

/* ── Separador dentro del panel */
.mob-separator {
  height: 1px;
  background: rgba(46,168,122,.1);
  margin: 6px 10px;
}

/* ── Link de peligro (logout) */
.mob-nav a.mob-danger { color: #c0392b; }
.mob-nav a.mob-danger svg { fill: #c0392b; }
.mob-nav a.mob-danger:hover { background: #fdf0ef; color: #a93226; }
.mob-nav a.mob-danger:hover svg { fill: #a93226; }

/* ── Estado invitado (no logueado) ── */
.mob-guest {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 20px 14px;
  background: linear-gradient(135deg, rgba(46,168,122,.07) 0%, transparent 100%);
  border-bottom: 1px solid rgba(46,168,122,.1);
  flex-shrink: 0;
}
.mob-guest-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #d4f0e4;
  border: 2px dashed rgba(46,168,122,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.mob-guest-icon svg { width: 24px; height: 24px; fill: #1a6b4a; }
.mob-guest-title {
  font-size: .9rem;
  font-weight: 600;
  color: #0d3b2e;
  margin-bottom: 3px;
}
.mob-guest-sub {
  font-size: .73rem;
  color: #5a7a6a;
  margin-bottom: 14px;
  line-height: 1.4;
}
.mob-guest-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px 16px;
  background: #0d3b2e;
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  transition: background .2s, transform .15s;
  margin-bottom: 8px;
}
.mob-guest-login:hover { background: #1a6b4a; transform: translateY(-1px); }
.mob-guest-login svg { width: 16px; height: 16px; fill: #fff; flex-shrink: 0; }
.mob-guest-register {
  font-size: .78rem;
  color: #1a6b4a;
  text-decoration: none;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .18s;
}
.mob-guest-register:hover { background: rgba(46,168,122,.1); }

/* ── Footer del panel (empujado al fondo) ── */
.mob-menu-footer {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid rgba(46,168,122,.1);
  font-size: .72rem;
  color: #5a7a6a;
  text-align: center;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════ */
/*  RESPONSIVE: mostrar hamburguesa, ocultar nav desktop  */
/* ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Header en móvil: fila simple logo + hamburguesa */
  header {
    flex-direction: row !important;
    height: 64px !important;
    padding: 0 16px !important;
    gap: 0 !important;
    justify-content: space-between;
    align-items: center;
  }

  /* Ocultar navegación desktop */
  header nav {
    display: none !important;
  }

  /* Mostrar botón hamburguesa */
  .hamburger-btn {
    display: flex !important;
  }
}

/* ── Tipografía ligeramente mayor en pantallas muy pequeñas ── */
@media (max-width: 400px) {
  .mob-menu { width: 92vw; max-width: 92vw; }
  .mob-user-name { font-size: 1rem; }
  .mob-user-doc  { font-size: .78rem; }
  .mob-nav a     { font-size: 1rem; padding: 12px 13px; }
  .mob-nav-label { font-size: .67rem; }
}
