/* ─── BOTTOM TAB BAR ─── Mobile only (≤768px) ─── */
/* Se añade encima de lo existente. No modifica nada del desktop. */
/* ── ORÁCULO v2 (07 Abr 2026): Tab Votar central elevado ── */

.mobile-tabbar {
  display: none; /* Oculto en desktop */
}

@media (max-width: 768px) {
  .mobile-tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--color-bg-deep, #080E1C);
    border-top: 1px solid rgba(255,255,255,0.08);
    /* iOS tabbar estándar: 49pt barra + safe-area. Rebajado de 12→8px vertical */
    padding: 4px 0;
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -2px 16px rgba(0,0,0,0.28);
  }

  .mobile-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--color-text-on-dark-low, rgba(255,255,255,0.42));
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 4px 6px;
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
    min-width: 48px;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-tabbar a:active {
    background: rgba(255,255,255,0.06);
  }

  .mobile-tabbar a.active {
    color: var(--color-accent, #0D9488);
  }

  .mobile-tabbar a.active svg {
    stroke: var(--color-accent, #0D9488);
  }

  /* Iconos normales: 20px (estándar iOS/Android tabbar) */
  .mobile-tabbar svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-tabbar a.active svg.fill-icon {
    fill: var(--color-accent, #0D9488);
    fill-opacity: 0.15;
  }

  .mobile-tabbar span {
    line-height: 1;
  }

  /* ─── Espacio inferior para que el contenido no quede tapado ───
     Altura real barra ≈ 52px (20 icono + 3 gap + 10 label + 8 padding vert).
     Dejamos un buffer pequeño para separar contenido. */
  body {
    padding-bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ─── Garantizar que NO aparece en desktop ─── */
@media (min-width: 769px) {
  .mobile-tabbar {
    display: none !important;
  }
  body {
    padding-bottom: 0 !important;
  }
}

/* ─── Page fade-in transition ─── */
@keyframes gm-fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

body {
  animation: gm-fadeIn 0.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }
}

/* ─── Skeleton loading ─── */
.gm-skeleton {
  background: linear-gradient(90deg,
    var(--color-bg-card, #111827) 25%,
    rgba(255,255,255,0.06) 50%,
    var(--color-bg-card, #111827) 75%
  );
  background-size: 200% 100%;
  animation: gm-shimmer 1.5s infinite ease-in-out;
  border-radius: 8px;
}

@keyframes gm-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.gm-skeleton-card {
  height: 200px;
  margin-bottom: 12px;
}

.gm-skeleton-text {
  height: 16px;
  margin-bottom: 8px;
  width: 70%;
}

.gm-skeleton-text.short {
  width: 40%;
}

/* Variante clara — para usar dentro de paneles con fondo blanco (panel ficha) */
.gm-skeleton--light {
  background: linear-gradient(90deg,
    rgba(11,31,56,0.05) 25%,
    rgba(11,31,56,0.10) 50%,
    rgba(11,31,56,0.05) 75%
  );
  background-size: 200% 100%;
  animation: gm-shimmer 1.5s infinite ease-in-out;
  border-radius: 8px;
}

/* Skeleton compuesto para la ficha de heladería (panel body loading) */
.gm-skeleton-panel {
  padding: 16px 20px;
}
.gm-skeleton-panel .sk-title   { height:22px; width:75%; margin-bottom:10px; border-radius:6px; }
.gm-skeleton-panel .sk-meta    { height:14px; width:45%; margin-bottom:18px; border-radius:4px; }
.gm-skeleton-panel .sk-img     { height:180px; width:100%;  margin-bottom:16px; border-radius:12px; }
.gm-skeleton-panel .sk-row     { height:14px; width:100%; margin-bottom:8px;  border-radius:4px; }
.gm-skeleton-panel .sk-row.alt { width:85%; }
.gm-skeleton-panel .sk-row.last{ width:55%; margin-bottom:0; }

@media (prefers-reduced-motion: reduce) {
  .gm-skeleton,
  .gm-skeleton--light {
    animation: none;
    background: var(--color-bg-card, #111827);
  }
  .gm-skeleton--light { background: rgba(11,31,56,0.06); }
}

/* ─── TAB VOTAR CENTRAL — Elevated CTA (ORÁCULO v2) ───
   Ajustado 18-abr-2026: reducido de 52→44px (estándar touch target iOS HIG). */
@media (max-width: 768px) {

  /* El tab Votar sale por encima del bar, como el "+" de Instagram.
     Elevación reducida de -16 a -12 para no invadir el viewport. */
  .mobile-tabbar a.tab-votar-cta {
    position: relative;
    top: -12px;
    color: var(--color-accent, #0D9488);
    font-weight: 700;
    font-size: 10px;
    min-width: 56px;
  }

  /* Burbuja elevada con fondo teal sólido (44px = iOS touch target mínimo) */
  .tab-votar-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent, #0D9488), var(--color-accent-mid, #0f766e));
    box-shadow: 0 3px 12px rgba(13, 148, 136, 0.42), 0 1px 3px rgba(0,0,0,0.3);
    margin-bottom: 2px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .tab-votar-bubble svg {
    width: 22px;
    height: 22px;
    fill: var(--color-white, #fff);
    stroke: none;
  }

  .mobile-tabbar a.tab-votar-cta:active .tab-votar-bubble {
    transform: scale(0.92);
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.35);
  }

  /* Pulse animation en el tab Votar para llamar la atención */
  @keyframes votar-pulse {
    0%, 100% { box-shadow: 0 3px 12px rgba(13, 148, 136, 0.42), 0 1px 3px rgba(0,0,0,0.3); }
    50%       { box-shadow: 0 3px 20px rgba(13, 148, 136, 0.75), 0 1px 3px rgba(0,0,0,0.3); }
  }

  /* Activa el pulse solo si el usuario lleva >15s sin votar (primera visita) */
  .mobile-tabbar.pulse-votar .tab-votar-bubble {
    animation: votar-pulse 2s ease-in-out infinite;
  }
}
