/* Prueba reversible: tarjetas municipales tipo medallon institucional. */
.theme-institucional #tabsMunicipios > button {
    position: relative;
    isolation: isolate;
    width: 11.5rem;
    min-width: 11.5rem;
    height: 15.5rem;
    padding: 1.15rem 1rem 1rem !important;
    gap: 0.85rem !important;
    overflow: hidden;
    border: 2px solid transparent !important;
    border-radius: 16px !important;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(
            135deg,
            #f2b705 0%,
            #f2b705 26%,
            #1e3a8a 50%,
            #1e3a8a 70%,
            #059669 100%
        ) border-box !important;
    box-shadow:
        0 16px 34px rgba(30, 58, 138, 0.15),
        0 6px 16px rgba(5, 150, 105, 0.08) !important;
    transform: translateY(0) scale(1) !important;
    transition:
        transform 380ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 320ms ease,
        filter 320ms ease !important;
}

.theme-institucional #tabsMunicipios > button::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 6px;
    width: auto;
    height: auto;
    pointer-events: none;
    border: 1px solid rgba(30, 58, 138, 0.09);
    border-radius: 10px;
    background:
        linear-gradient(
            135deg,
            rgba(242, 183, 5, 0.16) 0%,
            rgba(242, 183, 5, 0.06) 18%,
            transparent 18%,
            transparent 67%,
            rgba(5, 150, 105, 0.11) 67%,
            rgba(5, 150, 105, 0.18) 100%
        ),
        linear-gradient(
            90deg,
            rgba(30, 58, 138, 0.05),
            transparent 48%,
            rgba(30, 58, 138, 0.04)
        );
    opacity: 1;
    transform: none;
    transition: opacity 280ms ease, filter 320ms ease;
}

.theme-institucional #tabsMunicipios > button::after {
    content: "";
    position: absolute;
    z-index: 4;
    top: 0;
    right: 14%;
    bottom: auto;
    left: 14%;
    width: auto;
    height: 6px;
    pointer-events: none;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(
        90deg,
        #f2b705 0%,
        #f2b705 28%,
        #1e3a8a 46%,
        #1e3a8a 64%,
        #059669 82%,
        #059669 100%
    );
    background-size: 180% 100%;
    box-shadow: 0 3px 10px rgba(30, 58, 138, 0.16);
    opacity: 1;
    transform: none;
}

.theme-institucional #tabsMunicipios > button > div {
    position: relative;
    z-index: 2;
    display: grid !important;
    flex: 0 0 auto;
    place-items: center;
    width: 7.4rem !important;
    height: 7.4rem !important;
    margin: 0.35rem auto 0 !important;
    padding: 0.7rem;
    overflow: hidden;
    border: 3px solid rgba(242, 183, 5, 0.88);
    border-radius: 50%;
    outline: 3px solid rgba(30, 58, 138, 0.12);
    outline-offset: 3px;
    background: linear-gradient(145deg, #ffffff, #eef4ff) !important;
    box-shadow:
        0 13px 26px rgba(30, 58, 138, 0.16),
        0 4px 12px rgba(5, 150, 105, 0.13);
    transform: translateY(0) scale(1) rotate(0deg) !important;
    transition:
        transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 280ms ease,
        box-shadow 320ms ease,
        filter 320ms ease;
}

.theme-institucional #tabsMunicipios > button > div img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 12px rgba(30, 58, 138, 0.18));
}

.theme-institucional #tabsMunicipios > button > div > span.text-7xl {
    font-size: 4rem !important;
    line-height: 1;
}

.theme-institucional #tabsMunicipios > button[data-municipio]:not([data-municipio=""]) > div {
    width: 8rem !important;
    height: 8rem !important;
    padding: 0.15rem;
    overflow: visible;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent !important;
    box-shadow: none;
}

.theme-institucional #tabsMunicipios > button[data-municipio=""] > div > span {
    display: inline-block;
    transform-origin: center;
    will-change: transform;
    animation: municipality-globe-rotate 10s linear infinite !important;
}

.theme-institucional #tabsMunicipios .municipality-filter-label {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 0.25rem);
    min-height: 2.75rem;
    margin-top: auto;
    padding: 0.55rem 0.65rem;
    overflow: hidden;
    border: 1px solid rgba(242, 183, 5, 0.92);
    border-radius: 6px;
    background: linear-gradient(135deg, #12306f, #1e3a8a 58%, #2454a2);
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    -webkit-text-stroke: 0 transparent !important;
    box-shadow:
        0 9px 18px rgba(30, 58, 138, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
    font-size: 0.82rem !important;
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: 0 !important;
    text-align: center;
    text-shadow: 0 1px 2px rgba(18, 48, 111, 0.72) !important;
    transition:
        transform 340ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 240ms ease,
        box-shadow 280ms ease,
        background-color 280ms ease;
}

.theme-institucional #tabsMunicipios > button[aria-pressed="true"] {
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(135deg, #f2b705 0%, #1e3a8a 48%, #059669 100%) border-box !important;
    box-shadow:
        0 0 0 4px rgba(242, 183, 5, 0.16),
        0 19px 40px rgba(30, 58, 138, 0.20),
        0 8px 18px rgba(5, 150, 105, 0.12) !important;
}

.theme-institucional #tabsMunicipios > button[aria-pressed="true"]::after {
    right: 8%;
    left: 8%;
    height: 7px;
}

.theme-institucional #tabsMunicipios > button[aria-pressed="true"] > div {
    border-color: #f2b705;
    outline-color: rgba(5, 150, 105, 0.24);
    box-shadow:
        0 14px 30px rgba(30, 58, 138, 0.18),
        0 0 0 6px rgba(242, 183, 5, 0.08);
}

.theme-institucional #tabsMunicipios > button[data-municipio]:not([data-municipio=""])[aria-pressed="true"] > div {
    border: 0;
    outline: 0;
    box-shadow: none;
}

.theme-institucional #tabsMunicipios > button[aria-pressed="true"] .municipality-filter-label {
    border-color: #f2b705;
    background: linear-gradient(135deg, #12306f, #1e3a8a 52%, #057a57);
}

.theme-institucional #tabsMunicipios > button[aria-pressed="true"] .municipality-filter-label::before {
    content: "\2713";
    margin-right: 0.35rem;
    color: #f9d65c;
    -webkit-text-fill-color: #f9d65c;
    font-size: 0.82em;
}

@media (hover: hover) and (pointer: fine) and (min-width: 881px) {
    .theme-institucional #tabsMunicipios > button:hover {
        filter: saturate(1.08);
        transform: translateY(-10px) scale(1.035) !important;
        box-shadow:
            -8px 18px 32px rgba(242, 183, 5, 0.14),
            0 24px 44px rgba(30, 58, 138, 0.22),
            8px 18px 32px rgba(5, 150, 105, 0.14) !important;
    }

    .theme-institucional #tabsMunicipios > button:hover::before {
        filter: saturate(1.18);
        opacity: 0.88;
    }

    .theme-institucional #tabsMunicipios > button:hover::after {
        animation: municipality-premium-shine 900ms ease both;
    }

    .theme-institucional #tabsMunicipios > button:hover > div {
        border-color: #f6ca34;
        box-shadow:
            0 18px 34px rgba(30, 58, 138, 0.22),
            0 0 0 7px rgba(5, 150, 105, 0.09);
        filter: saturate(1.12);
        transform: translateY(-5px) scale(1.09) rotate(-1deg) !important;
    }

    .theme-institucional #tabsMunicipios > button[data-municipio]:not([data-municipio=""]):hover > div {
        border: 0;
        outline: 0;
        box-shadow: none;
    }

    .theme-institucional #tabsMunicipios > button:hover .municipality-filter-label {
        border-color: #f9d65c;
        box-shadow:
            0 13px 24px rgba(30, 58, 138, 0.28),
            0 0 0 3px rgba(242, 183, 5, 0.10);
        transform: translateY(-2px) scale(1.035);
    }
}

@keyframes municipality-premium-shine {
    from {
        background-position: 100% 0;
    }

    to {
        background-position: 0 0;
    }
}

@keyframes municipality-globe-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 880px) {
    .theme-institucional #tabsMunicipios > button {
        width: 100%;
        min-width: 0;
        height: 8.25rem;
        padding: 0.55rem 0.3rem 0.45rem !important;
        gap: 0.45rem !important;
        border-width: 1.5px !important;
        border-radius: 10px !important;
        box-shadow:
            0 10px 20px rgba(30, 58, 138, 0.13),
            0 4px 10px rgba(5, 150, 105, 0.07) !important;
    }

    .theme-institucional #tabsMunicipios > button::before {
        inset: 4px;
        border-radius: 7px;
    }

    .theme-institucional #tabsMunicipios > button::after {
        right: 12%;
        left: 12%;
        height: 4px;
        border-radius: 0 0 4px 4px;
    }

    .theme-institucional #tabsMunicipios > button > div {
        width: 4rem !important;
        height: 4rem !important;
        margin-top: 0.15rem !important;
        padding: 0.35rem;
        border-width: 2px;
        outline-width: 2px;
        outline-offset: 2px;
        box-shadow:
            0 8px 15px rgba(30, 58, 138, 0.14),
            0 3px 8px rgba(5, 150, 105, 0.10);
        transform: none !important;
    }

    .theme-institucional #tabsMunicipios > button[data-municipio]:not([data-municipio=""]) > div {
        width: 4.35rem !important;
        height: 4.35rem !important;
        padding: 0.1rem;
        overflow: visible;
        border: 0;
        border-radius: 0;
        outline: 0;
        background: transparent !important;
        box-shadow: none;
    }

    .theme-institucional #tabsMunicipios > button > div > span.text-7xl {
        font-size: 2.5rem !important;
    }

    .theme-institucional #tabsMunicipios .municipality-filter-label {
        display: -webkit-box;
        width: 100%;
        min-height: 2.25em;
        padding: 0.32rem 0.15rem;
        border-radius: 4px;
        overflow-wrap: normal;
        word-break: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        font-size: 0.52rem !important;
        line-height: 1.15;
    }

    .theme-institucional #tabsMunicipios > button[aria-pressed="true"] {
        box-shadow:
            0 0 0 3px rgba(242, 183, 5, 0.14),
            0 12px 22px rgba(30, 58, 138, 0.16) !important;
    }
}

@media (max-width: 360px) {
    .theme-institucional #tabsMunicipios .municipality-filter-label {
        font-size: 0.48rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .theme-institucional #tabsMunicipios > button,
    .theme-institucional #tabsMunicipios > button::before,
    .theme-institucional #tabsMunicipios > button::after,
    .theme-institucional #tabsMunicipios > button > div,
    .theme-institucional #tabsMunicipios .municipality-filter-label {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

}
