/* Todo va bajo .rs-ag para ganarle en especificidad al kit global de Elementor (h3, a). */

.rs-ag {
    --rs-ag-azul: var(--e-global-color-6c9f2d8, #1f3a64);
    --rs-ag-dorado: #b8966c;
    --rs-ag-gris: #9691a4;
    --rs-ag-boton: #3a8fd5;
    --rs-ag-foto: 130px;
    --rs-ag-gap: 28px;
}

.rs-ag .rs-ag-grilla {
    display: grid;
    grid-template-columns: repeat(var(--rs-ag-col-d, 3), minmax(0, 1fr));
    gap: var(--rs-ag-gap);
}

@media (max-width: 1024px) {
    .rs-ag .rs-ag-grilla {
        grid-template-columns: repeat(var(--rs-ag-col-t, 2), minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .rs-ag {
        --rs-ag-gap: 20px;
    }
    .rs-ag .rs-ag-grilla {
        grid-template-columns: repeat(var(--rs-ag-col-m, 1), minmax(0, 1fr));
    }
}

/* ─── Card ──────────────────────────────────────────────────────────────── */

.rs-ag .rs-ag-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    padding-bottom: 28px;
    overflow: hidden;
    text-align: center;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    transition: box-shadow .2s ease, transform .2s ease;
}

.rs-ag .rs-ag-card:hover {
    box-shadow: 0 0 0 1px rgba(16, 24, 40, .05), 0 10px 24px rgba(16, 24, 40, .12);
    transform: translateY(-2px);
}

.rs-ag .rs-ag-oculta {
    display: none !important;
}

.rs-ag .rs-ag-banner {
    width: 100%;
    aspect-ratio: 642 / 201;
    background: var(--rs-ag-azul) var(--rs-ag-banner, none) center / cover no-repeat;
}

.rs-ag .rs-ag-foto {
    position: relative;
    width: var(--rs-ag-foto);
    height: var(--rs-ag-foto);
    max-width: none;
    margin: calc(var(--rs-ag-foto) / -2) 0 0;
    object-fit: cover;
    background: #e9edf3;
    border: 4px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.rs-ag .rs-ag-nombre {
    margin: 12px 16px 0;
    padding: 0;
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--rs-ag-gris);
}

.rs-ag .rs-ag-enlace {
    color: inherit;
    text-decoration: none;
}

/* Hace clickeable toda la card sin anidar links: los íconos quedan por encima. */
.rs-ag .rs-ag-enlace::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 10px;
}

.rs-ag .rs-ag-enlace:focus-visible {
    outline: none;
}

.rs-ag .rs-ag-enlace:focus-visible::after {
    outline: 3px solid var(--rs-ag-dorado);
    outline-offset: -3px;
}

.rs-ag .rs-ag-redes {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    padding: 0 16px;
}

.rs-ag .rs-ag-red {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    text-decoration: none;
}

.rs-ag .rs-ag-red:focus-visible {
    outline: 2px solid var(--rs-ag-dorado);
    outline-offset: 2px;
}

.rs-ag .rs-ag-icono {
    display: block;
    width: 26px;
    height: 26px;
    background-color: var(--rs-ag-azul);
    -webkit-mask: var(--rs-ag-i) center / contain no-repeat;
    mask: var(--rs-ag-i) center / contain no-repeat;
    transition: background-color .15s ease;
}

.rs-ag .rs-ag-red:hover .rs-ag-icono,
.rs-ag .rs-ag-red:focus-visible .rs-ag-icono {
    background-color: var(--rs-ag-dorado);
}

.rs-ag .rs-ag-red--instagram { --rs-ag-i: url(../iconos/instagram.svg); }
.rs-ag .rs-ag-red--linkedin  { --rs-ag-i: url(../iconos/linkedin.svg); }
.rs-ag .rs-ag-red--tiktok    { --rs-ag-i: url(../iconos/tiktok.svg); }
.rs-ag .rs-ag-red--whatsapp  { --rs-ag-i: url(../iconos/whatsapp.svg); }
.rs-ag .rs-ag-red--telefono  { --rs-ag-i: url(../iconos/telefono.svg); }
.rs-ag .rs-ag-red--mail      { --rs-ag-i: url(../iconos/mail.svg); }
.rs-ag .rs-ag-red--web       { --rs-ag-i: url(../iconos/web.svg); }
.rs-ag .rs-ag-red--casa      { --rs-ag-i: url(../iconos/casa.svg); }

.rs-ag .rs-ag-cinta {
    position: absolute;
    top: 20px;
    left: -40px;
    z-index: 2;
    width: 160px;
    padding: 5px 0;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
    color: #fff;
    background: var(--rs-ag-dorado);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .18);
    transform: rotate(-45deg);
    pointer-events: none;
}

/* ─── Botones y estados ────────────────────────────────────────────────── */

.rs-ag .rs-ag-acciones {
    margin-top: 32px;
    text-align: center;
}

.rs-ag .rs-ag-boton {
    display: inline-block;
    padding: 10px 24px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    background: var(--rs-ag-boton);
    border: 0;
    border-radius: 4px;
}

.rs-ag .rs-ag-boton:hover,
.rs-ag .rs-ag-boton:focus-visible {
    color: #fff;
    background: var(--rs-ag-azul);
}

.rs-ag .rs-ag-boton[hidden] {
    display: none;
}

.rs-ag .rs-ag-dir-estado {
    min-height: 1.4em;
    margin: 12px 0 16px;
    color: #5f5b6e;
}

.rs-ag-aviso {
    padding: 12px 16px;
    background: #fff8e5;
    border-left: 4px solid #dba617;
}

/* ─── Campo de búsqueda ────────────────────────────────────────────────── */

.rs-ag .rs-ag-input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 1rem;
    color: #1d2330;
    background: #fff;
    border: 1px solid #cfd5e1;
    border-radius: 8px;
    box-sizing: border-box;
}

.rs-ag .rs-ag-input:focus {
    outline: none;
    border-color: var(--rs-ag-azul);
    box-shadow: 0 0 0 3px rgba(31, 58, 100, .15);
}

.rs-ag-buscador {
    position: relative;
    margin-bottom: 24px;
}

.rs-ag .rs-ag-sugerencias {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 50;
    max-height: 360px;
    margin: 0;
    padding: 6px 0;
    overflow-y: auto;
    list-style: none;
    background: #fff;
    border: 1px solid #dfe3eb;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, .14);
}

.rs-ag .rs-ag-sugerencias[hidden] {
    display: none;
}

.rs-ag .rs-ag-sugerencia {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 8px 14px;
    color: #1d2330;
    cursor: pointer;
}

.rs-ag .rs-ag-sugerencia[aria-selected="true"],
.rs-ag .rs-ag-sugerencia:hover {
    background: #eef2f8;
}

.rs-ag .rs-ag-sugerencia img {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
}

.rs-ag .rs-ag-sugerencia-vacia {
    padding: 10px 14px;
    color: #5f5b6e;
    cursor: default;
}

.rs-ag .rs-ag-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .rs-ag .rs-ag-card,
    .rs-ag .rs-ag-icono {
        transition: none;
    }
    .rs-ag .rs-ag-card:hover {
        transform: none;
    }
}
