/* Base compartida (sitio público + admin): variables, reinicio, botones y popups */

:root {
    --bg: #FAF8F6;
    --ink: #2B2523;
    --muted: #6F6861;
    --faint: #9A938C;
    --line: #E8E1DA;
    --line-suave: #EFE9E3;
    --accent: #B85F3D;
    --accent-oscuro: #A2502F;
    --accent-suave: #E3B9A6;
    --ok: #5F7F58;
    --aviso: #B5862B;
    --error: #B23B3B;
    --serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
    --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    padding: 1rem 1.7rem;
    font-family: var(--sans);
    font-size: .6875rem;
    font-weight: 500;
    letter-spacing: .2em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid transparent;
    background: transparent;
    transition: background-color .25s, color .25s, border-color .25s, opacity .25s;
}
.btn-principal { background: var(--accent); color: #fff; font-weight: 600; }
.btn-principal:hover { background: var(--accent-oscuro); }
.btn-borde { border-color: var(--accent-suave); color: var(--accent); }
.btn-borde:hover { border-color: var(--accent); background: rgba(184, 95, 61, .05); }
.btn-peligro { border-color: #E4B8B8; color: var(--error); }
.btn-peligro:hover { border-color: var(--error); background: rgba(178, 59, 59, .05); }
.btn:disabled { opacity: .55; cursor: default; }

/* Popups (avisos, confirmaciones, errores) */
.popup-fondo {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(43, 37, 35, .38);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .2s;
}
.popup-fondo.visible { opacity: 1; }

.popup {
    width: 100%;
    max-width: 27rem;
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    padding: 2.25rem 2rem 1.75rem;
    background: var(--bg);
    border: 1px solid var(--line);
    text-align: center;
    transform: translateY(8px);
    transition: transform .25s;
}
.popup-fondo.visible .popup { transform: none; }

.popup-icono { display: flex; justify-content: center; margin-bottom: 1.1rem; }
.popup-exito .popup-icono { color: var(--ok); }
.popup-warning .popup-icono { color: var(--aviso); }
.popup-error .popup-icono { color: var(--error); }
.popup-info .popup-icono { color: var(--accent); }

.popup-titulo {
    margin: 0 0 .6rem;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.9rem;
    line-height: 1.15;
    color: var(--accent);
}
.popup-mensaje { margin: 0 0 1rem; color: var(--muted); font-weight: 300; font-size: .95rem; line-height: 1.6; }

.popup-detalle {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: .9rem 1rem;
    border: 1px solid var(--line-suave);
    background: rgba(255, 255, 255, .55);
    text-align: left;
    font-size: .85rem;
    line-height: 1.55;
    color: var(--ink);
    max-height: 14rem;
    overflow-y: auto;
    word-break: break-word;
}
.popup-detalle li + li { margin-top: .4rem; padding-top: .4rem; border-top: 1px solid var(--line-suave); }

.popup-acciones { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.popup-acciones .btn { min-width: 8.5rem; padding: .9rem 1.2rem; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
