/* Protección de Datos Web — banner.css | https://protecciondatosweb.cl */

:root {
    --pdw-accent:  #2563eb;
    --pdw-radius:  8px;
    --pdw-z:       99999;
    --pdw-speed:   0.28s;
    --pdw-dark-bg: #1a2332;
    --pdw-dark-tx: #ffffff;
    --pdw-dark-muted: rgba(255,255,255,0.72);
    --pdw-light-bg: #ffffff;
    --pdw-light-tx: #111827;
    --pdw-light-muted: #6b7280;
}

/* ── BANNER BASE ── */

#pdw-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: var(--pdw-z);
    padding: 14px 20px;
    background: var(--pdw-dark-bg);
    color: var(--pdw-dark-tx);
    box-sizing: border-box;
    transform: translateY(100%);
    transition: transform var(--pdw-speed) ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    border-top: 1px solid rgba(255,255,255,0.08);
}

#pdw-banner.pdw-show {
    transform: translateY(0);
}

/* Tema claro */
#pdw-banner.pdw-light {
    background: var(--pdw-light-bg);
    color: var(--pdw-light-tx);
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

/* Layout interno */
.pdw-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.pdw-content {
    flex: 1;
    min-width: 240px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pdw-icon {
    flex-shrink: 0;
    color: var(--pdw-accent);
    margin-top: 2px;
}

#pdw-banner.pdw-light .pdw-icon { color: var(--pdw-accent); }

.pdw-text strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.pdw-text p {
    margin: 0;
    font-size: 12px;
    color: var(--pdw-dark-muted);
}

#pdw-banner.pdw-light .pdw-text p { color: var(--pdw-light-muted); }

.pdw-text a {
    color: var(--pdw-accent);
    text-decoration: underline;
}

/* Acciones */
.pdw-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Botones */
.pdw-btn {
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    padding: 7px 14px;
    transition: opacity 0.15s, transform 0.1s;
    white-space: nowrap;
    line-height: 1;
}

.pdw-btn:active { transform: scale(0.97); }

.pdw-primary {
    background: var(--pdw-accent);
    color: #fff;
    border: none;
}

.pdw-primary:hover { opacity: 0.88; }

.pdw-secondary {
    background: transparent;
    color: var(--pdw-dark-tx);
    border: 1px solid rgba(255,255,255,0.28);
}

#pdw-banner.pdw-light .pdw-secondary {
    color: var(--pdw-light-tx);
    border-color: #d1d5db;
}

.pdw-secondary:hover { background: rgba(255,255,255,0.08); }
#pdw-banner.pdw-light .pdw-secondary:hover { background: #f3f4f6; }

.pdw-ghost {
    background: transparent;
    color: var(--pdw-dark-muted);
    border: none;
    text-decoration: underline;
    padding: 7px 8px;
}

#pdw-banner.pdw-light .pdw-ghost { color: var(--pdw-light-muted); }

/* Branding */
.pdw-branding {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    text-decoration: none;
    white-space: nowrap;
    margin-left: 4px;
}

.pdw-branding:hover { color: rgba(255,255,255,0.6); }
#pdw-banner.pdw-light .pdw-branding { color: #9ca3af; }

/* ── PANEL DE PREFERENCIAS ── */

#pdw-prefs {
    position: fixed;
    inset: 0;
    z-index: calc(var(--pdw-z) + 1);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--pdw-speed) ease;
}

#pdw-prefs.pdw-show {
    opacity: 1;
}

.pdw-prefs-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.pdw-prefs-panel {
    position: relative;
    background: #fff;
    color: #111827;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 540px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    transform: translateY(40px);
    transition: transform var(--pdw-speed) ease;
}

#pdw-prefs.pdw-show .pdw-prefs-panel {
    transform: translateY(0);
}

.pdw-prefs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.pdw-prefs-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

#pdw-close-prefs {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    color: #9ca3af;
    line-height: 1;
    padding: 0 4px;
}

#pdw-close-prefs:hover { color: #111827; }

.pdw-prefs-body {
    padding: 4px 0 8px;
}

/* Categorías */
.pdw-cat {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 16px;
}

.pdw-cat-info {
    flex: 1;
}

.pdw-cat-info strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
}

.pdw-cat-info p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.45;
}

.pdw-badge-always {
    font-size: 11px;
    background: #f0fdf4;
    color: #15803d;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 500;
}

/* Toggle switch */
.pdw-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.pdw-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.pdw-toggle span {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 24px;
    transition: background 0.2s;
}

.pdw-toggle span::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.pdw-toggle input:checked + span { background: var(--pdw-accent); }
.pdw-toggle input:checked + span::before { transform: translateX(20px); }
.pdw-toggle input:focus + span { outline: 2px solid var(--pdw-accent); outline-offset: 2px; }

/* Footer del panel */
.pdw-prefs-foot {
    padding: 16px 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
    position: sticky;
    bottom: 0;
}

.pdw-prefs-foot .pdw-primary {
    padding: 10px 18px;
    font-size: 13px;
}

.pdw-prefs-foot .pdw-secondary {
    padding: 10px 14px;
    font-size: 13px;
    color: #374151;
    border-color: #d1d5db;
}

.pdw-prefs-foot .pdw-secondary:hover { background: #f9fafb; }

/* ── BOTÓN FLOTANTE REOPEN ── */

#pdw-reopen {
    position: fixed !important;
    bottom: 16px !important;
    left: 16px !important;
    z-index: var(--pdw-z) !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background: #185fa5 !important;
    color: #ffffff !important;
    border: none !important;
    cursor: pointer;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 14px rgba(15,32,64,0.35) !important;
    transition: transform 0.15s, background 0.2s !important;
    line-height: 0 !important;
    overflow: visible !important;
}

/* Forzar tamaño y color del SVG — evita que el tema de WordPress lo colapse */
#pdw-reopen svg {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    display: block !important;
    stroke: #ffffff !important;
    stroke-width: 2.2 !important;
    fill: none !important;
    color: #ffffff !important;
    vertical-align: middle !important;
    max-width: none !important;
    max-height: none !important;
}

#pdw-reopen svg path {
    stroke: #ffffff !important;
    fill: none !important;
}

#pdw-reopen:hover {
    transform: scale(1.08) !important;
    background: #0e4a82 !important;
}

/* ── FORMULARIO ARCO ── */

.pdw-arco-wrap {
    max-width: 560px;
}

.pdw-arco-msg {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.pdw-arco-msg.pdw-ok  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.pdw-arco-msg.pdw-err { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }

.pdw-field {
    margin-bottom: 16px;
}

.pdw-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    color: inherit;
}

.pdw-optional {
    font-weight: 400;
    color: #9ca3af;
}

.pdw-field input[type="text"],
.pdw-field input[type="email"],
.pdw-field select,
.pdw-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: #111827;
    transition: border-color 0.15s;
}

.pdw-field input:focus,
.pdw-field select:focus,
.pdw-field textarea:focus {
    outline: none;
    border-color: var(--pdw-accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.pdw-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pdw-checkbox input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--pdw-accent);
}

.pdw-checkbox label {
    font-size: 13px;
    font-weight: 400;
    margin: 0;
}

.pdw-arco-wrap button[type="submit"] {
    background: var(--pdw-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
    margin-top: 4px;
}

.pdw-arco-wrap button[type="submit"]:hover    { opacity: 0.88; }
.pdw-arco-wrap button[type="submit"]:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── RESPONSIVE ── */

@media (max-width: 600px) {
    #pdw-banner { padding: 12px; }
    .pdw-inner  { flex-direction: column; align-items: stretch; gap: 10px; }
    .pdw-actions { gap: 6px; }
    .pdw-btn { font-size: 12px; padding: 8px 10px; }
    .pdw-prefs-panel { max-height: 92vh; }
}
