/* botones reutilizables */
.btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--ring);
    background: #fff;
    text-decoration: none;
    color: var(--fg);
    font-weight: 600;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    will-change: transform;
}

.btn i {
    font-size: 20px
}

.btn small {
    display: block;
    font-weight: 400;
    color: var(--muted);
    line-height: 1.3;
}

.btn:hover {
    transform: translateY(-2px);
    border-color: #d1d5db;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .06);
}

.btn.whatsapp {
    border-color: #d1f7df;
}

/* badges reutilizables */
.badge {
    margin-left: auto;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--card);
    color: var(--muted);
    border: 1px solid var(--ring);
}

/* ===== Header / Nav ===== */
.site-header {
    --h: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--h);
    padding: 0 16px;
    gap: 12px;
    border-bottom: 1px solid var(--ring);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.site-header .brand img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.site-header .brand span {
    font-weight: 800;
    letter-spacing: .01em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-nav a {
    text-decoration: none;
    color: var(--fg);
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease;
}

.site-nav a:hover {
    background: #f8f8f8;
    border-color: #eee;
}

.site-nav a.active {
    border-color: var(--ring);
    background: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .05);
}

/* Toggle (mobile) */
.nav-toggle {
    display: none;
    width: 40px;
    height: 36px;
    border: 1px solid var(--ring);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: #111;
}

@media (max-width: 860px) {
    .nav-toggle {
        display: flex;
    }

    .site-nav {
        position: fixed;
        top: 64px;
        /* justo debajo del header (usa tu --h si cambias alto) */
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100dvh - 64px);
        overflow: auto;
        background: #fff;
        border-bottom: 1px solid var(--ring);
        padding: 10px 16px;
        gap: 0;
        flex-direction: column;
        align-items: stretch;

        /* ESTADO CERRADO: “guardado” bajo la barra */
        transform-origin: 50% 0;
        /* origen arriba */
        transform: scaleY(0);
        /* colapsado vertical */
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        box-shadow: none;

        transition:
            transform .22s ease,
            opacity .22s ease,
            visibility 0s linear .22s;
        /* oculta visibilidad tras la animación */
        z-index: 1000;
        -webkit-overflow-scrolling: touch;
    }

    .site-nav a {
        padding: 12px;
        border-radius: 12px;
    }

    /* ESTADO ABIERTO */
    .site-nav.open {
        transform: scaleY(1);
        /* desplegado desde la barra */
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        box-shadow: 0 12px 24px rgba(0, 0, 0, .08);

        transition:
            transform .22s ease,
            opacity .22s ease,
            visibility 0s;
        /* sin retardo al abrir */
    }

    /* opcional: bloquear scroll del body cuando está abierto */
    body.nav-open {
        overflow: hidden;
        touch-action: none;
    }

    /* Accesibilidad: si el usuario prefiere menos movimiento, desactiva animaciones */
    @media (prefers-reduced-motion: reduce) {

        .site-nav,
        .site-nav.open {
            transition: none !important;
        }
    }
}