/* ══════════════════════════════════════════════════════════════════════
   WF WAF — Dropzone  (prefijo: .wf-waf-dz-)
   Adaptado del sistema de dropzone de WF.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Zona de Drop ─────────────────────────────────────────────────── */
.wf-waf-dz {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    background: #fafbfc;
    padding: 22px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s;
    box-sizing: border-box;
    overflow: hidden;
}

.wf-waf-dz:hover {
    border-color: var(--wf-accent, #6c63ff);
    background: #f5f4ff;
}

.wf-waf-dz.dz-drag {
    border-color: var(--wf-accent, #6c63ff);
    background: #f0efff;
    box-shadow: 0 0 0 4px rgba(108, 99, 255, .12);
}

.wf-waf-dz.dz-uploading { pointer-events: none; opacity: .85; }
.wf-waf-dz.dz-has-error { border-color: #e2401c !important; background: #fff5f5 !important; }

/* ── Icon upload ──────────────────────────────────────────────────── */
.wf-waf-dz-icon {
    display: block; margin: 0 auto 8px;
    width: 36px; height: 36px;
    color: #9ca3af; transition: color .2s;
}
.wf-waf-dz:hover .wf-waf-dz-icon,
.wf-waf-dz.dz-drag .wf-waf-dz-icon { color: var(--wf-accent, #6c63ff); }

/* ── Texts ────────────────────────────────────────────────────────── */
.wf-waf-dz-title {
    display: block; font-size: 13px; font-weight: 600;
    color: #374151; margin-bottom: 3px;
}
.wf-waf-dz-sub {
    display: block; font-size: 11.5px; color: #9ca3af; margin-bottom: 10px;
}

/* ── Pills ────────────────────────────────────────────────────────── */
.wf-waf-dz-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; }
.wf-waf-dz-pill {
    display: inline-flex; align-items: center; gap: 4px;
    background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 20px;
    font-size: 11px; font-weight: 600; color: #6b7280; padding: 2px 9px;
}
.wf-waf-dz-pill svg { width: 11px; height: 11px; flex-shrink: 0; }

/* ── Spinner ──────────────────────────────────────────────────────── */
.wf-waf-dz-loading { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0; }
.wf-waf-dz-spinner {
    display: block; width: 28px; height: 28px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--wf-accent, #6c63ff);
    border-radius: 50%;
    animation: wfDzSpin .7s linear infinite;
}
@keyframes wfDzSpin { to { transform: rotate(360deg); } }
.wf-waf-dz-loading-text { font-size: 12px; color: #6b7280; }

/* ── Success (single file) ────────────────────────────────────────── */
.wf-waf-dz-success {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.wf-waf-dz-preview-img {
    display: block; max-width: 140px; max-height: 110px;
    object-fit: contain; border-radius: 7px;
    border: 1px solid #e5e7eb; box-shadow: 0 2px 5px rgba(0,0,0,.07);
}
.wf-waf-dz-file-icon {
    display: flex; align-items: center; justify-content: center;
    width: 46px; height: 46px;
    background: #eff3ff; border-radius: 9px;
    color: var(--wf-accent, #6c63ff);
}
.wf-waf-dz-file-icon svg { width: 24px; height: 24px; }
.wf-waf-dz-filename {
    font-size: 12px; font-weight: 600; color: #1f2937;
    word-break: break-all; text-align: center; max-width: 200px;
}
.wf-waf-dz-ok-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: #dcfce7; color: #166534;
    font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px;
}

/* ── Gallery grid ─────────────────────────────────────────────────── */
.wf-waf-dz-gallery {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 4px 0; justify-content: center;
}
.wf-waf-dz-gallery-item {
    position: relative; width: 72px; height: 72px;
    border-radius: 7px; overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    flex-shrink: 0;
}
.wf-waf-dz-gallery-item img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.wf-waf-dz-gallery-item .wf-waf-dz-rm {
    position: absolute; top: 2px; right: 2px;
    width: 18px; height: 18px;
    background: rgba(0,0,0,.55); border: none; border-radius: 50%;
    color: #fff; font-size: 11px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0; line-height: 1;
    transition: background .15s;
}
.wf-waf-dz-gallery-item .wf-waf-dz-rm:hover { background: #b32d2e; }
.wf-waf-dz-gallery-add {
    width: 72px; height: 72px;
    border: 2px dashed #d1d5db; border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    color: #9ca3af; font-size: 22px; cursor: pointer;
    transition: border-color .15s, color .15s;
    flex-shrink: 0; background: none;
}
.wf-waf-dz-gallery-add:hover { border-color: var(--wf-accent, #6c63ff); color: var(--wf-accent, #6c63ff); }
.wf-waf-dz-gallery-spinner {
    width: 72px; height: 72px; border-radius: 7px;
    border: 1px solid #e5e7eb; background: #f3f4f6;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ── Change / retry button ────────────────────────────────────────── */
.wf-waf-dz-change {
    background: none; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 12px; color: #6b7280; padding: 4px 11px;
    cursor: pointer; transition: border-color .15s, color .15s;
}
.wf-waf-dz-change:hover { border-color: var(--wf-accent, #6c63ff); color: var(--wf-accent, #6c63ff); }

/* ── Error inside zone ────────────────────────────────────────────── */
.wf-waf-dz-err-msg {
    display: flex; align-items: center; gap: 7px;
    color: #dc2626; font-size: 12.5px; font-weight: 600; padding: 4px 0;
}

/* ── Wysiwyg ──────────────────────────────────────────────────────── */
.wf-waf-wysiwyg-wrap { display: flex; flex-direction: column; gap: 0; }
.wf-waf-wysiwyg-toolbar {
    display: flex; flex-wrap: wrap; gap: 2px;
    background: #f6f7f7; border: 1.5px solid #dcdcde;
    border-bottom: none; border-radius: 7px 7px 0 0;
    padding: 5px 7px;
}
.wf-waf-wysiwyg-toolbar button {
    background: none; border: 1px solid transparent; border-radius: 4px;
    width: 26px; height: 26px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #50575e;
    padding: 0; transition: background .12s, border-color .12s;
}
.wf-waf-wysiwyg-toolbar button:hover {
    background: #ebebeb; border-color: #c3c4c7;
}
.wf-waf-wysiwyg-toolbar button.is-active {
    background: rgba(var(--wf-rgb, 108,99,255),.12);
    border-color: var(--wf-accent, #6c63ff);
    color: var(--wf-accent, #6c63ff);
}
.wf-waf-wysiwyg-body {
    min-height: 100px; max-height: 300px; overflow-y: auto;
    border: 1.5px solid #dcdcde; border-top: none;
    border-radius: 0 0 7px 7px;
    padding: 10px 12px; font-size: 13.5px; color: #1e1e1e;
    line-height: 1.6; background: #fff; outline: none;
    box-sizing: border-box;
}
.wf-waf-wysiwyg-body:focus {
    border-color: var(--wf-accent, #6c63ff);
    box-shadow: 0 0 0 2px rgba(var(--wf-rgb, 108,99,255),.12);
}
.wf-waf-wysiwyg-body p { margin: 0 0 .5em; }
.wf-waf-wysiwyg-body ul, .wf-waf-wysiwyg-body ol { margin: 0 0 .5em; padding-left: 1.6em; }

/* ── Bottom-sheet (camera/gallery, mobile) ────────────────────────── */
#wf-waf-cam-sheet { display: none; position: fixed; inset: 0; z-index: 999999; }
#wf-waf-cam-sheet.wf-sheet-open { display: block; }
#wf-waf-cam-backdrop {
    position: absolute; inset: 0; background: rgba(0,0,0,.5);
}
#wf-waf-cam-panel {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: #fff; border-radius: 16px 16px 0 0;
    padding: 18px 16px 32px; max-width: 480px; margin: 0 auto;
}
#wf-waf-cam-title {
    font-size: 12px; font-weight: 600; color: #888;
    text-align: center; margin: 0 0 12px;
    text-transform: uppercase; letter-spacing: .06em;
}
#wf-waf-cam-panel button {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 13px 16px; margin-bottom: 7px;
    border: 1px solid #e5e7eb; border-radius: 10px;
    background: #fff; font-size: 15px; color: #111827;
    cursor: pointer; font-family: inherit;
}
#wf-waf-cam-panel button:active { background: #f3f4f6; }
#wf-waf-cam-cancel {
    justify-content: center; color: #6b7280;
    border-color: transparent; margin-bottom: 0;
}
