/* ==========================================================================
   Acciones de tarjeta del buscador: favorito, reporte y sus diálogos
   ========================================================================== */

.service-card-actions {
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.service-favorite,
.service-report {
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.service-favorite:hover,
.service-report:hover { transform: translateY(-2px); }

.service-favorite:hover,
.service-favorite.is-active {
    color: #e11d48;
    border-color: rgba(225, 29, 72, 0.3);
    background: rgba(225, 29, 72, 0.08);
}

.service-report:hover {
    color: var(--amber);
    border-color: rgba(180, 83, 9, 0.32);
    background: var(--amber-soft);
}

.service-favorite:disabled { opacity: 0.6; cursor: default; transform: none; }

.service-favorite:focus-visible,
.service-report:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Diálogos
   -------------------------------------------------------------------------- */
body.has-action-modal { overflow: hidden; }

.action-modal {
    position: fixed;
    z-index: 1250;
    inset: 0;
    display: grid;
    padding: clamp(0.75rem, 4vw, 2.5rem);
    place-items: center;
}

.action-modal[hidden] { display: none; }

.action-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 11, 26, 0.62);
    backdrop-filter: blur(6px);
    animation: actionFade 0.2s ease both;
}

.action-modal-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(520px, 100%);
    max-height: min(88vh, 760px);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 40px 90px rgba(3, 8, 24, 0.4);
    animation: actionIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes actionFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes actionIn {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.action-modal-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.25rem 1.35rem 1.1rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface-soft), #fff);
}

.action-modal-icon {
    flex: none;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--primary);
    border-radius: 14px;
    background: rgba(50, 85, 215, 0.1);
    font-size: 1rem;
}

.action-modal-icon.is-warning { color: var(--amber); background: var(--amber-soft); }

.action-modal-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.14rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.action-modal-head p {
    margin: 0.28rem 0 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.action-modal-head > div { flex: 1; min-width: 0; }

.action-modal-close {
    flex: none;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease;
}

.action-modal-close:hover { color: var(--ink); background: var(--surface-soft); }

.action-modal-body {
    display: grid;
    gap: 0.9rem;
    padding: 1.25rem 1.35rem 1.45rem;
    overflow-y: auto;
}

/* Campos */
.action-field { display: grid; gap: 0.35rem; }

.action-field > span {
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 850;
}

.action-field input,
.action-field select,
.action-field textarea {
    width: 100%;
    padding: 0.72rem 0.9rem;
    color: var(--ink);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: 0.93rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.action-field textarea { line-height: 1.6; resize: vertical; }

.action-field input:focus,
.action-field select:focus,
.action-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(50, 85, 215, 0.14);
    outline: none;
}

.action-field-hint { color: var(--muted); font-size: 0.78rem; }

.action-field-error:not(:empty) {
    color: #b42318;
    font-size: 0.79rem;
    font-weight: 750;
}

.action-alert {
    padding: 0.7rem 0.85rem;
    color: #b42318;
    border: 1px solid rgba(220, 38, 38, 0.24);
    border-radius: 12px;
    background: var(--red-soft);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.5;
}

.action-alert[hidden] { display: none; }

.action-modal-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
    padding: 0.75rem 0.9rem;
    color: var(--text);
    border: 1px solid rgba(50, 85, 215, 0.18);
    border-radius: 12px;
    background: rgba(50, 85, 215, 0.06);
    font-size: 0.83rem;
    line-height: 1.55;
}

.action-modal-note i { margin-top: 0.15rem; color: var(--primary); }

.action-modal-submit { width: 100%; justify-content: center; }

.action-modal-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
}

/* Confirmación */
.action-success {
    justify-items: center;
    text-align: center;
}

.action-success[hidden] { display: none; }

.action-success-icon {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    color: var(--green);
    border-radius: 50%;
    background: var(--green-soft);
    font-size: 1.3rem;
}

.action-success h3 {
    margin: 0;
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 900;
}

.action-success p {
    margin: 0;
    max-width: 40ch;
    color: var(--muted);
    font-size: 0.89rem;
    line-height: 1.6;
}

@media (max-width: 575.98px) {
    .action-modal { padding: 0; place-items: end center; }

    .action-modal-dialog {
        width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .action-modal-dialog,
    .action-modal-backdrop { animation: none; }
    .service-favorite:hover,
    .service-report:hover { transform: none; }
}
