/**
 * Botones comunes (autopyme_components) — aspecto del tema clásico para las clases que las
 * pantallas pueden usar en vez de estilos propios:
 *   .apc-button + .apc-button--filled | --tonal | --outlined | --text | --elevated (+ --danger)
 *   .apc-icon-button (+ --filled | --tonal | --outlined)
 * Mismo aspecto que los botones actuales de la app (esquinas 0.625rem, peso 600, alto 2.5rem).
 * El tema md3 los redefine en themes/md3/components/action_button.css (botones de M3).
 * Tema por variables --apc-button-* (valores por defecto: los del tema clásico).
 */

.apc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-sizing: border-box;
    min-height: 2.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.625rem;
    background-color: transparent;
    color: var(--apc-button-text, var(--apc-color-primary, #0369a1));
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.apc-button .material-symbols-outlined {
    font-size: 1.125rem;
}

.apc-button--filled {
    background-color: var(--apc-button-filled-bg, var(--apc-color-primary, #0369a1));
    color: var(--apc-button-filled-text, var(--apc-color-on-primary, #ffffff));
    box-shadow: 0 1px 3px rgba(3, 105, 161, 0.3);
}

.apc-button--tonal {
    background-color: var(--apc-button-tonal-bg, var(--apc-color-secondary-container, #e2e8f0));
    color: var(--apc-button-tonal-text, var(--apc-color-on-secondary-container, #0f172a));
}

.apc-button--outlined {
    border-color: var(--apc-button-border, var(--apc-color-outline, #cbd5e1));
}

.apc-button--text {
    padding: 0.5rem 0.75rem;
}

.apc-button--elevated {
    background-color: var(--apc-button-elevated-bg, var(--apc-color-surface, #ffffff));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.apc-button--danger {
    color: var(--apc-button-danger, var(--apc-color-error, #b91c1c));
}

.apc-button--filled.apc-button--danger {
    background-color: var(--apc-button-danger, var(--apc-color-error, #b91c1c));
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(185, 28, 28, 0.3);
}

.apc-button:hover:not(:disabled),
.apc-icon-button:hover:not(:disabled) {
    background-color: var(--apc-button-hover-bg, rgba(148, 163, 184, 0.16));
}

.apc-button--filled:hover:not(:disabled) {
    background-color: var(--apc-button-filled-bg-hover, #075985);
}

.apc-button--filled.apc-button--danger:hover:not(:disabled) {
    background-color: #991b1b;
}

.apc-button:disabled,
.apc-icon-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.apc-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    width: var(--apc-touch-target, 2.75rem);
    height: var(--apc-touch-target, 2.75rem);
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    background-color: transparent;
    color: var(--apc-button-icon, var(--apc-color-on-surface-variant, #334155));
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.apc-icon-button .material-symbols-outlined {
    font-size: 1.25rem;
}

.apc-icon-button--filled {
    background-color: var(--apc-button-filled-bg, var(--apc-color-primary, #0369a1));
    color: var(--apc-button-filled-text, var(--apc-color-on-primary, #ffffff));
}

.apc-icon-button--tonal {
    background-color: var(--apc-button-tonal-bg, var(--apc-color-secondary-container, #e2e8f0));
    color: var(--apc-button-tonal-text, var(--apc-color-on-secondary-container, #0f172a));
}

.apc-icon-button--outlined {
    border-color: var(--apc-button-border, var(--apc-color-outline, #cbd5e1));
}
