/* 3D Marketplace Creator 2.4 — botón y diálogo de denuncia
   Móvil primero. Prefijo: thirty-report. Puede cargarse sin style.css ni wall.css:
   cada token --t-* lleva su valor de respaldo. Modo oscuro: [data-thirty-theme="dark"]
   (lo pone report.js según la preferencia "thirty_theme", igual que wall.js). */

/* ═══ BOTÓN (discreto: no compite con "Añadir al carrito") ═══════ */
.thirty-report-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 36px;
    padding: 0.3rem 0.55rem;
    border: 0;
    border-radius: var(--t-pill, 999px);
    background: transparent;
    color: var(--t-muted, #475569);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.thirty-report-btn > span[aria-hidden="true"] { font-size: 0.85em; filter: grayscale(0.35); }
.thirty-report-btn:hover:not(:disabled) {
    background: var(--t-surface-2, #f8fafc);
    color: var(--t-error, #b91c1c);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.thirty-report-btn:focus-visible { outline: 3px solid var(--t-focus, #2563eb); outline-offset: 2px; }
.thirty-report-btn:disabled,
.thirty-report-btn.is-reported { cursor: default; opacity: 0.75; text-decoration: none; }

/* Ficha de producto (woocommerce_single_product_summary) */
.product .summary .thirty-report-btn,
.thirty-report-btn--product { margin-top: 0.5rem; }

/* Pie de la tarjeta del muro: compartir y denunciar juntos a la derecha */
.thirty-wall-card__foot > .thirty-wall-share { margin-left: auto; }
.thirty-wall-card__foot > .thirty-report-btn { flex-shrink: 0; }
@media (max-width: 380px) {
    .thirty-wall-card__foot { flex-wrap: wrap; }
}

/* ═══ DIÁLOGO ════════════════════════════════════════════════════ */
html.thirty-report-noscroll { overflow: hidden; }

.thirty-report {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-family: var(--t-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    color: var(--t-text, #1e293b);
    line-height: 1.5;
}
.thirty-report[hidden], .thirty-report [hidden] { display: none !important; }
.thirty-report *, .thirty-report *::before, .thirty-report *::after { box-sizing: border-box; }
.thirty-report p, .thirty-report h2, .thirty-report fieldset { margin: 0; }

.thirty-report__backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, 0.6); }

.thirty-report__dialog {
    position: relative;
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    border-radius: var(--t-radius-lg, 20px) var(--t-radius-lg, 20px) 0 0;
    background: var(--t-surface, #ffffff);
    box-shadow: var(--t-shadow-lg, 0 12px 32px rgba(15, 23, 42, 0.10));
    animation: thirty-report-in 0.22s ease-out;
}
.thirty-report__dialog:focus { outline: none; }
.thirty-report :focus-visible { outline: 3px solid var(--t-focus, #2563eb); outline-offset: 2px; }

@keyframes thirty-report-in {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.thirty-report__head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.35rem; }
.thirty-report__title { font-size: 1.15rem; font-weight: 800; color: var(--t-primary, #0f172a); }
.thirty-report__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--t-surface-2, #f8fafc);
    color: var(--t-text, #1e293b);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}
.thirty-report__close:hover { background: var(--t-border, #e2e8f0); }

.thirty-report__object { color: var(--t-muted, #475569); font-size: 0.92rem; margin-bottom: 0.9rem; overflow-wrap: anywhere; }
.thirty-report__object-title { color: var(--t-text, #1e293b); }

.thirty-report__body { display: grid; gap: 0.9rem; }

.thirty-report__group { border: 0; padding: 0; min-width: 0; display: grid; gap: 0.4rem; }
.thirty-report__legend { padding: 0; margin-bottom: 0.4rem; font-weight: 700; font-size: 0.95rem; }
.thirty-report__reason {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid var(--t-border, #e2e8f0);
    border-radius: var(--t-sm, 10px);
    background: var(--t-surface, #ffffff);
    font-size: 0.92rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.thirty-report__reason:hover { border-color: var(--t-border-strong, #cbd5e1); }
.thirty-report__reason input { flex-shrink: 0; width: 18px; height: 18px; margin: 0.1rem 0 0; accent-color: var(--t-accent, #1d4ed8); }
.thirty-report__reason:has(input:checked) { border-color: var(--t-accent, #1d4ed8); background: var(--t-accent-bg, #eff6ff); }

.thirty-report__claim {
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--t-warning-border, #fde68a);
    border-radius: var(--t-sm, 10px);
    background: var(--t-warning-bg, #fef3c7);
    color: var(--t-warning, #92400e);
    font-size: 0.88rem;
}

.thirty-report__field { display: grid; gap: 0.3rem; }
.thirty-report__label { font-weight: 700; font-size: 0.92rem; }
.thirty-report__req { font-weight: 500; color: var(--t-muted, #475569); font-size: 0.85em; }
.thirty-report__input {
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid var(--t-border-strong, #cbd5e1);
    border-radius: var(--t-sm, 10px);
    background: var(--t-surface, #ffffff);
    color: var(--t-text, #1e293b);
    font: inherit;
    font-size: 1rem; /* 16px: evita el zoom de iOS */
}
textarea.thirty-report__input { resize: vertical; min-height: 6.5rem; }
.thirty-report__input:focus-visible { outline: 3px solid var(--t-focus, #2563eb); outline-offset: 1px; }
.thirty-report__input[aria-invalid="true"] { border-color: var(--t-error, #b91c1c); }

.thirty-report__hint { font-size: 0.8rem; color: var(--t-muted, #475569); }
.thirty-report__hint.is-over { color: var(--t-error, #b91c1c); font-weight: 700; }
.thirty-report__error { font-size: 0.84rem; font-weight: 700; color: var(--t-error, #b91c1c); }

.thirty-report__check { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.88rem; cursor: pointer; }
.thirty-report__check input { flex-shrink: 0; width: 20px; height: 20px; margin: 0.1rem 0 0; accent-color: var(--t-accent, #1d4ed8); }

.thirty-report__as { font-size: 0.85rem; color: var(--t-muted, #475569); }
.thirty-report__legal { font-size: 0.78rem; color: var(--t-muted, #475569); border-top: 1px solid var(--t-border, #e2e8f0); padding-top: 0.75rem; }

/* Honeypot: fuera de la vista y del orden de tabulación */
.thirty-report__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Estado del envío (aria-live) */
.thirty-report__status { margin-top: 0.9rem; font-size: 0.9rem; font-weight: 600; }
.thirty-report__status:empty { display: none; }
.thirty-report__status.is-info { color: var(--t-muted, #475569); }
.thirty-report__status.is-error {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--t-error-border, #fecaca);
    border-radius: var(--t-sm, 10px);
    background: var(--t-error-bg, #fee2e2);
    color: var(--t-error, #b91c1c);
}
.thirty-report__link { color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }

/* ═══ ACCIONES ═══════════════════════════════════════════════════ */
.thirty-report__actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    margin-top: 1rem;
}
.thirty-report__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.6rem 1.2rem;
    border: 2px solid transparent;
    border-radius: var(--t-pill, 999px);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.thirty-report__btn:disabled { opacity: 0.65; cursor: progress; }
.thirty-report__btn--primary { background: var(--t-accent, #1d4ed8); color: #ffffff; }
.thirty-report__btn--primary:hover:not(:disabled) { background: var(--t-accent-hover, #1e40af); color: #ffffff; }
.thirty-report__btn--ghost { background: transparent; color: var(--t-muted, #475569); }
.thirty-report__btn--ghost:hover { background: var(--t-surface-2, #f8fafc); color: var(--t-text, #1e293b); }

.thirty-report__login p { font-size: 0.95rem; }

.thirty-report__done { text-align: center; padding: 0.5rem 0 0; }
.thirty-report__done-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 0.6rem !important;
    border-radius: 50%;
    background: var(--t-success-bg, #dcfce7);
    color: var(--t-success, #15803d);
    font-size: 1.6rem;
    font-weight: 800;
}
.thirty-report__done-msg { font-size: 1rem; font-weight: 600; }
.thirty-report__done-msg:focus { outline: none; }

/* ═══ ESCRITORIO: diálogo centrado ═══════════════════════════════ */
@media (min-width: 600px) {
    .thirty-report { align-items: center; padding: 1.5rem; }
    .thirty-report__dialog {
        max-width: 560px;
        max-height: calc(100vh - 3rem);
        padding: 1.4rem 1.5rem;
        border-radius: var(--t-radius-lg, 20px);
    }
    .thirty-report__actions { flex-direction: row; justify-content: flex-end; }
}

/* ═══ MODO OSCURO ════════════════════════════════════════════════ */
.thirty-report[data-thirty-theme="dark"] {
    --t-primary: #f1f5f9;
    --t-accent: #60a5fa;
    --t-accent-hover: #93c5fd;
    --t-accent-bg: rgba(96, 165, 250, 0.14);
    --t-surface: #1e293b;
    --t-surface-2: #172033;
    --t-border: #334155;
    --t-border-strong: #475569;
    --t-text: #e2e8f0;
    --t-muted: #a3b1c6;
    --t-success: #4ade80;
    --t-success-bg: rgba(74, 222, 128, 0.12);
    --t-warning: #fbbf24;
    --t-warning-bg: rgba(251, 191, 36, 0.12);
    --t-warning-border: rgba(251, 191, 36, 0.3);
    --t-error: #f87171;
    --t-error-bg: rgba(248, 113, 113, 0.12);
    --t-error-border: rgba(248, 113, 113, 0.3);
    --t-focus: #93c5fd;
    --t-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
}
.thirty-report[data-thirty-theme="dark"] .thirty-report__btn--primary,
.thirty-report[data-thirty-theme="dark"] .thirty-report__btn--primary:hover:not(:disabled) { color: #0f172a; }
.thirty-report[data-thirty-theme="dark"] .thirty-report__backdrop { background: rgba(2, 6, 23, 0.8); }
[data-thirty-theme="dark"] .thirty-report-btn:hover:not(:disabled) { background: rgba(148, 163, 184, 0.12); }

/* ═══ MOVIMIENTO REDUCIDO ════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .thirty-report__dialog { animation: none; }
    .thirty-report *, .thirty-report-btn { transition: none !important; }
}
