/* ===================================================================================== */
/* ===== Página de Municipios — Estilo consistente con NegocioDetalle ================ */
/* ===================================================================================== */

#tmEstado {
    --tm-primary: #ff7b00;
    --tm-primary-2: #ff9d4a;
    --tm-bg: #fbfbfd;
    --tm-card: #ffffff;
    --tm-text: #1f2937;
    --tm-muted: #6b7280;
    --tm-border: rgba(0,0,0,.06);
}

/* ===== HERO ===== */
#tmEstado .tm-hero {
    position: relative;
    padding: 20px 18px;
    border-radius: 16px;
    background: 
        radial-gradient(1200px 400px at -10% -80%, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 40%),
        linear-gradient(135deg, var(--tm-primary) 0%, var(--tm-primary-2) 100%);
    color: #fff;
    overflow: hidden;
}

#tmEstado .tm-title {
    margin: 0 0 .35rem 0;
    font-weight: 800;
    font-size: clamp(1.3rem, 2.2vw, 1.85rem);
    letter-spacing: .2px;
    display: flex;
    align-items: center;
    gap: .5rem;
}

#tmEstado .tm-title i {
    font-size: 1.1em;
    opacity: .9;
}

#tmEstado .tm-sub {
    margin: 0;
    opacity: .88;
    font-size: .92rem;
}

/* ===== Subtítulo de sección ===== */
#tmEstado .tm-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    color: var(--tm-text);
    margin-bottom: 1rem;
}

#tmEstado .tm-section-title i {
    color: var(--tm-primary);
}

/* ===== Grid de tarjetas ===== */
#tmEstado .tm-munis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (max-width: 575.98px) {
    #tmEstado .tm-munis-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

/* ===== Tarjeta estilo claro (consistente con NegocioDetalle) ===== */
#tmEstado .tm-card {
    position: relative;
    border: 1px solid rgba(255,123,0,.18);
    border-radius: 14px;
    background: var(--tm-card);
    overflow: hidden;
    transition: transform .12s ease, box-shadow .2s ease;
}

/* Barra superior gradiente (como en NegocioDetalle) */
#tmEstado .tm-card::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--tm-primary), var(--tm-primary-2));
    flex-shrink: 0;
}

#tmEstado .tm-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(255,123,0,.14);
}

/* Círculos blur sutiles (efecto moderno pero claro) */
#tmEstado .tm-card::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    right: -20px;
    top: -20px;
    z-index: 0;
    background: linear-gradient(135deg, rgba(255,123,0,.08), rgba(255,157,74,.05));
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}

#tmEstado .tm-card:hover::after {
    opacity: 1;
}

/* ===== Enlace dentro de la tarjeta ===== */
#tmEstado .tm-link {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.1rem;
    text-decoration: none;
    color: var(--tm-text);
    font-weight: 600;
    font-size: .95rem;
    min-height: 64px;
    transition: color .2s ease;
}

#tmEstado .tm-link:hover {
    color: var(--tm-primary);
}

#tmEstado .tm-link:focus-visible {
    outline: 3px solid rgba(255,123,0,.35);
    outline-offset: -3px;
    border-radius: 12px;
}

/* Nombre del municipio */
#tmEstado .tm-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Flecha con transición */
#tmEstado .tm-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255,123,0,.08);
    color: var(--tm-primary);
    font-size: .85rem;
    flex-shrink: 0;
    transition: transform .2s ease, background .2s ease;
}

#tmEstado .tm-link:hover .tm-arrow {
    transform: translateX(3px);
    background: rgba(255,123,0,.15);
}

/* ===== Spinner de carga ===== */
#tmEstado .tm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 1rem;
}

#tmEstado .tm-loading-text {
    color: var(--tm-muted);
    font-size: .9rem;
}

/* ===== Animación de entrada escalonada ===== */
@keyframes tm-card-enter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#tmEstado .tm-card {
    animation: tm-card-enter .35s ease backwards;
}

#tmEstado .tm-card:nth-child(1) { animation-delay: 0ms; }
#tmEstado .tm-card:nth-child(2) { animation-delay: 25ms; }
#tmEstado .tm-card:nth-child(3) { animation-delay: 50ms; }
#tmEstado .tm-card:nth-child(4) { animation-delay: 75ms; }
#tmEstado .tm-card:nth-child(5) { animation-delay: 100ms; }
#tmEstado .tm-card:nth-child(6) { animation-delay: 125ms; }
#tmEstado .tm-card:nth-child(7) { animation-delay: 150ms; }
#tmEstado .tm-card:nth-child(8) { animation-delay: 175ms; }
#tmEstado .tm-card:nth-child(n+9) { animation-delay: 200ms; }

/* ===== Responsive ===== */
@media (max-width: 575.98px) {
    #tmEstado .tm-hero {
        padding: 16px 14px;
        border-radius: 12px;
    }

    #tmEstado .tm-title {
        font-size: 1.15rem;
    }

    #tmEstado .tm-card {
        border-radius: 12px;
    }

    #tmEstado .tm-link {
        padding: .85rem .9rem;
        font-size: .88rem;
        min-height: 56px;
    }

    #tmEstado .tm-arrow {
        width: 24px;
        height: 24px;
        font-size: .75rem;
    }

    #tmEstado .tm-section-title {
        font-size: .95rem;
    }
}

/* ===== Skeleton loading (opcional) ===== */
#tmEstado .tm-skeleton {
    background: linear-gradient(90deg, rgba(0,0,0,.04), rgba(0,0,0,.08), rgba(0,0,0,.04));
    background-size: 200% 100%;
    animation: tm-shimmer 1.5s infinite linear;
    border-radius: 14px;
    height: 64px;
}

@keyframes tm-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
