/* ==========================================================================
   MiMarket — Web pública · base.css
   Sistema de diseño: verde retail + Inter + flat/minimal (UI UX Pro Max)
   IMPORTANTE: TODO está namespaced bajo .mm-site para que este CSS jamás
   se filtre al panel Tabler. No hay selectores globales (html, body, *).
   ========================================================================== */

/* ---------- Design tokens ---------- */
.mm-site {
    /* Marca */
    --mm-primary: #059669;
    --mm-primary-hover: #047857;
    --mm-primary-soft: #ecfdf5;
    --mm-accent: #f97316;
    --mm-accent-soft: #fff7ed;
    --mm-whatsapp: #25d366;
    --mm-whatsapp-hover: #1ebe5d;

    /* Tinta / neutros */
    --mm-ink-900: #0f172a;
    --mm-ink-700: #334155;
    --mm-ink-600: #475569;
    --mm-ink-400: #94a3b8;

    /* Superficies */
    --mm-bg: #ffffff;
    --mm-bg-soft: #f8fafc;
    --mm-border: #e2e8f0;

    /* Espaciado (base 8px) */
    --mm-space-1: 0.25rem;
    --mm-space-2: 0.5rem;
    --mm-space-3: 0.75rem;
    --mm-space-4: 1rem;
    --mm-space-5: 1.5rem;
    --mm-space-6: 2rem;
    --mm-space-7: 3rem;
    --mm-space-8: 4rem;
    --mm-space-9: 6rem;
    --mm-space-10: 8rem;

    /* Formas */
    --mm-radius-sm: 8px;
    --mm-radius: 12px;
    --mm-radius-lg: 18px;
    --mm-radius-pill: 999px;

    /* Sombra (flat: muy sutil) */
    --mm-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --mm-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);

    /* Capas */
    --mm-z-header: 50;
    --mm-z-floating: 40;

    /* Tipografía */
    --mm-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset scoped ---------- */
.mm-site,
.mm-site *,
.mm-site *::before,
.mm-site *::after {
    box-sizing: border-box;
}

.mm-site {
    margin: 0;
    font-family: var(--mm-font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--mm-ink-600);
    background-color: var(--mm-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.mm-site h1,
.mm-site h2,
.mm-site h3,
.mm-site h4,
.mm-site h5 {
    margin: 0;
    color: var(--mm-ink-900);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.mm-site p { margin: 0; }
.mm-site a { color: inherit; text-decoration: none; }
.mm-site img,
.mm-site svg { max-width: 100%; display: block; }
.mm-site ul { margin: 0; padding: 0; list-style: none; }
.mm-site button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }

/* ---------- Foco accesible ---------- */
.mm-site a:focus-visible,
.mm-site button:focus-visible,
.mm-site input:focus-visible,
.mm-site select:focus-visible {
    outline: 3px solid rgba(5, 150, 105, 0.45);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---------- Layout / container ---------- */
.mm-container {
    width: 100%;
    max-width: 1120px;
    margin-inline: auto;
    padding-inline: var(--mm-space-5);
}

.mm-section {
    padding-block: var(--mm-space-9);
}
.mm-section--soft {
    background-color: var(--mm-bg-soft);
    border-block: 1px solid var(--mm-border);
}
.mm-section__head {
    max-width: 640px;
    margin-inline: auto;
    margin-bottom: var(--mm-space-7);
    text-align: center;
}
.mm-section__eyebrow {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mm-primary);
    margin-bottom: var(--mm-space-2);
}
.mm-section__title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
}
.mm-section__subtitle {
    margin-top: var(--mm-space-3);
    font-size: 1.0625rem;
    color: var(--mm-ink-600);
}

/* ---------- Tipografía utilitaria ---------- */
.mm-eyebrow {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mm-primary);
}
.mm-text-accent { color: var(--mm-primary); }
.mm-muted { color: var(--mm-ink-400); }

/* ---------- Badges ---------- */
.mm-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--mm-space-1);
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--mm-radius-pill);
    background: var(--mm-primary-soft);
    color: var(--mm-primary-hover);
}
.mm-badge--accent {
    background: var(--mm-accent-soft);
    color: #c2410c;
}
.mm-badge--muted {
    background: #f1f5f9;
    color: var(--mm-ink-600);
}

/* ---------- Botones ---------- */
.mm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--mm-space-2);
    padding: 0.625rem 1.125rem;
    min-height: 44px; /* touch target */
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--mm-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease,
                border-color 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
}
.mm-btn svg { width: 1.15em; height: 1.15em; }

.mm-btn--primary {
    background-color: var(--mm-primary);
    color: #ffffff;
}
.mm-btn--primary:hover {
    background-color: var(--mm-primary-hover);
    color: #ffffff;
    box-shadow: var(--mm-shadow-sm);
}

.mm-btn--accent {
    background-color: var(--mm-accent);
    color: #ffffff;
}
.mm-btn--accent:hover {
    background-color: #ea580c;
    color: #ffffff;
}

.mm-btn--ghost {
    background-color: transparent;
    color: var(--mm-ink-700);
    border-color: var(--mm-border);
}
.mm-btn--ghost:hover {
    background-color: var(--mm-bg-soft);
    border-color: #cbd5e1;
    color: var(--mm-ink-900);
}

.mm-btn--whatsapp {
    background-color: var(--mm-whatsapp);
    color: #ffffff;
}
.mm-btn--whatsapp:hover {
    background-color: var(--mm-whatsapp-hover);
    color: #ffffff;
}

.mm-btn--lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    min-height: 52px;
}
.mm-btn--block {
    width: 100%;
}
.mm-btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---------- WhatsApp flotante (FAB) ----------
   Vive en base.css (cargado en TODAS las páginas públicas: landing y registro)
   para que tenga el mismo tamaño correcto en ambas. Tamaño fijo + flex-shrink:0
   para que el SVG nunca se expanda. */
.mm-site .mm-whatsapp-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: var(--mm-z-floating);
    /* Tamaño bloqueado: width/height + min + max + aspect-ratio. El círculo es
       indeformable aunque otra regla (flex del padre, reset global, etc.) intente
       estirarlo. */
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    max-width: 56px;
    max-height: 56px;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
    padding: 0;
    line-height: 0;
    border-radius: 50%;
    background: var(--mm-whatsapp);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
    transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.mm-site .mm-whatsapp-fab:hover {
    background: var(--mm-whatsapp-hover);
    box-shadow: 0 8px 22px rgba(37, 211, 102, 0.55);
    transform: scale(1.05);
}
.mm-site .mm-whatsapp-fab svg {
    /* Ícono con tamaño fijo, sin posibilidad de encogerse ni estirarse. */
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    flex: 0 0 auto;
    display: block;
}

/* ---------- Animación reveal-on-scroll ---------- */
.mm-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.mm-reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .mm-site * {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
    .mm-reveal { opacity: 1; transform: none; }
}
