/* ACF Repeater for Elementor — Frontend */

/* ── Design tokens ──────────────────────────────────────────────────────── */

:root {
    /* Colors */
    --arb-border-color:    #e5e7eb;
    --arb-bg-table-header: #f9fafb;
    --arb-bg-card:         #fff;
    --arb-text-muted:      #6b7280;

    /* Shape & spacing */
    --arb-radius:          8px;
    --arb-gap-items:       8px;     /* vertical gap between accordion items */
    --arb-gap-cols:        16px;    /* horizontal gap between 2-col accordion columns */
    --arb-padding-acc:     16px 20px; /* accordion header padding (also used in Elementor reset) */
    --arb-padding-body:    20px;    /* accordion body content padding */
    --arb-icon-gap:        12px;    /* gap between toggle icon and title text */

    /* Motion */
    --arb-transition-acc:
        max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity    0.3s ease;
}

.arb-grid {
    display: grid;
    gap: 24px;
    /* grid-template-columns se genera dinámicamente por Elementor según el control responsive */
}

.arb-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.arb-table-wrap {
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--arb-border-color);
    box-sizing: border-box;
}

.arb-table-wrap.arb-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.arb-table {
    width: 100%;
    border-collapse: collapse;
    margin-block-end: 0;
}

.arb-table th,
.arb-table td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: break-word;
    border-right: 1px solid var(--arb-border-color);
    border-bottom: 1px solid var(--arb-border-color);
}

/* No right border on last column — handled by outer border */
.arb-table th:last-child,
.arb-table td:last-child {
    border-right: none;
}

/* No bottom border on last tbody row — handled by outer border */
.arb-table tbody tr:last-child td {
    border-bottom: none;
}

.arb-table thead th {
    background: var(--arb-bg-table-header);
    font-weight: 600;
}

.arb-td,
.arb-row-header {
    vertical-align: top;
}

.arb-td img,
.arb-row-header img {
    display: block;
    max-width: 100%;
    height: auto;
}

.arb-row-header {
    font-weight: 600;
    text-align: left;
}

.arb-item {
    box-sizing: border-box;
    background-color: transparent;
}

.arb-sf {
    display: block;
}

.arb-sf img {
    display: block;
    max-width: 100%;
}

.arb-no-results {
    display: block;
    padding: 16px var(--arb-padding-body);
    color: var(--arb-text-muted);
    font-style: italic;
    text-align: center;
}

/* Los breakpoints responsive del grid se generan por Elementor según la configuración del widget */

/* ── ARB Accordion ─────────────────────────────────────────────────────── */

.arb-accordion {
    display: flex;
    flex-direction: column;
    gap: var(--arb-gap-items);
}

.arb-accordion.arb-accordion-cols-2 {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: var(--arb-gap-cols);
}

.arb-acc-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--arb-gap-items);
    min-width: 0;
}

.arb-acc-item {
    border: 1px solid var(--arb-border-color);
    border-radius: var(--arb-radius);
    overflow: hidden;
    background: var(--arb-bg-card);
    min-width: 0;
}

.arb-acc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: var(--arb-padding-acc);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    gap: var(--arb-icon-gap);
}

.arb-acc-question {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
}

.arb-acc-icon {
    flex-shrink: 0;
}

.arb-acc-body {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: var(--arb-transition-acc);
}

.arb-acc-content {
    padding: 0 var(--arb-padding-body) var(--arb-padding-body);
}

.arb-acc-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-top: var(--arb-icon-gap);
}

.arb-acc-icon--close {
    display: none;
}

.arb-acc-item.is-open .arb-acc-icon--open {
    display: none;
}

.arb-acc-item.is-open .arb-acc-icon--close {
    display: inline-flex;
}

.arb-accordion.arb-icon-left .arb-acc-header {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

@media (max-width: 767px) {
    .arb-accordion.arb-accordion-cols-2 {
        flex-direction: column;
    }
    .arb-accordion.arb-accordion-cols-2 .arb-acc-col {
        width: 100%;
    }
}

/* ── Neutralizar hover/focus/active de button que inyecta Elementor ───────── */
/*
 * Especificidad deliberada: .arb-accordion .arb-acc-header = (0,2,0)
 * supera a .elementor-kit-10 button = (0,1,1) en todos los estados.
 */

.arb-accordion .arb-acc-header,
.arb-accordion .arb-acc-header:hover,
.arb-accordion .arb-acc-header:focus,
.arb-accordion .arb-acc-header:active {
    background-color: transparent;
    color: inherit;
    text-decoration: none;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    padding: var(--arb-padding-acc);
    display: flex;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    transition: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Restore accessible keyboard focus indicator (same specificity as reset above,
 * placed after so it wins via source order — WCAG 2.4.7). */
.arb-accordion .arb-acc-header:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

/* ── Alineación del título ─────────────────────────────────────────────── */

.arb-acc-header--center .arb-acc-question { text-align: center; }
.arb-acc-header--right  .arb-acc-question { text-align: right; }

/* Ancho completo: icono en flujo flex normal, título ocupa todo el espacio disponible */
.arb-acc-header--full {
    justify-content: space-between;
    align-items: flex-start;
}
.arb-acc-header--full .arb-acc-question {
    flex: 1;
    text-align: left;
}
/* El icono permanece en el flujo — flex-shrink:0 ya definido en .arb-acc-icon */
/* icon-left + full: el row-reverse de .arb-icon-left ya lo coloca a la izquierda */
