/* LOPDP Ecuador — UI pública v1.0.4
 * Diseño: mini-aviso estilo Bershka. Esquina inferior izquierda, compacto,
 * monocromático estricto (blanco/negro/grises), blindado contra herencia
 * de WooCommerce/Elementor/temas.
 */

#lopdp-cookie-banner,
#lopdp-consent-popup,
.lopdp-consent-field,
.lopdp-rights-form,
.lopdp-manage-cookies-btn {
    --lopdp-bg: #ffffff;
    --lopdp-fg: #09090b;
    --lopdp-muted: #71717a;
    --lopdp-border: #e4e4e7;
    --lopdp-surface: #fafafa;
    --lopdp-surface-2: #f4f4f5;
    --lopdp-shadow: 0 8px 24px -8px rgba(0,0,0,.12), 0 2px 6px -2px rgba(0,0,0,.05);
    --lopdp-radius: 10px;
    --lopdp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-family: var(--lopdp-font);
    box-sizing: border-box;
}
#lopdp-cookie-banner *,
#lopdp-consent-popup *,
.lopdp-consent-field * { box-sizing: border-box; }

/* ============================================================
 * MINI AVISO unificado (cookies + LOPDP) — estilo Bershka.
 * ============================================================ */
#lopdp-cookie-banner.lopdp-mini {
    position: fixed !important;
    z-index: 999998;
    width: 300px;
    max-width: calc(100vw - 32px);
    background: var(--lopdp-bg) !important;
    color: var(--lopdp-fg) !important;
    border: 1px solid var(--lopdp-border);
    border-radius: var(--lopdp-radius);
    box-shadow: var(--lopdp-shadow);
    padding: 0;
    margin: 0;
    animation: lopdp-mini-in 220ms cubic-bezier(.16,1,.3,1);
}
#lopdp-cookie-banner.lopdp-mini[hidden] { display: none !important; }

#lopdp-cookie-banner.lopdp-pos-bottom-left { left: 16px; bottom: 16px; right: auto; top: auto; }
#lopdp-cookie-banner.lopdp-pos-bottom-right { right: 16px; bottom: 16px; left: auto; top: auto; }
#lopdp-cookie-banner.lopdp-pos-bottom {
    left: 50%; bottom: 16px; right: auto; top: auto;
    transform: translateX(-50%);
}
#lopdp-cookie-banner.lopdp-pos-top { left: 16px; top: 16px; right: auto; bottom: auto; }

#lopdp-cookie-banner.lopdp-theme-dark {
    background: var(--lopdp-fg) !important;
    color: var(--lopdp-bg) !important;
    border-color: #27272a !important;
}
#lopdp-cookie-banner.lopdp-theme-dark .lopdp-mini-body { color: #d4d4d8 !important; }
#lopdp-cookie-banner.lopdp-theme-dark .lopdp-mini-link { color: var(--lopdp-bg) !important; }
#lopdp-cookie-banner.lopdp-theme-dark .lopdp-mini-close { color: #a1a1aa !important; }
#lopdp-cookie-banner.lopdp-theme-dark .lopdp-mini-close:hover { background: #27272a !important; color: var(--lopdp-bg) !important; }

.lopdp-mini-inner {
    position: relative;
    padding: 16px 16px 14px;
}

.lopdp-mini-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: 0 !important;
    border-radius: 6px;
    color: var(--lopdp-muted) !important;
    cursor: pointer;
    padding: 0 !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}
.lopdp-mini-close:hover {
    background: var(--lopdp-surface-2) !important;
    color: var(--lopdp-fg) !important;
}

.lopdp-mini-title {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    margin: 0 24px 4px 0 !important;
    color: var(--lopdp-fg) !important;
    font-family: var(--lopdp-font) !important;
    text-transform: none !important;
    letter-spacing: -0.01em !important;
}
#lopdp-cookie-banner.lopdp-theme-dark .lopdp-mini-title { color: var(--lopdp-bg) !important; }

.lopdp-mini-body {
    font-size: 12.5px !important;
    line-height: 1.5 !important;
    color: var(--lopdp-muted) !important;
    margin: 0 0 6px 0 !important;
    font-family: var(--lopdp-font) !important;
}

.lopdp-mini-link {
    display: inline-block;
    font-size: 12px !important;
    color: var(--lopdp-fg) !important;
    text-decoration: underline !important;
    margin: 0 0 12px 0 !important;
    font-family: var(--lopdp-font) !important;
}
.lopdp-mini-link:hover { color: var(--lopdp-fg) !important; }

.lopdp-mini-actions {
    display: flex !important;
    gap: 6px;
    justify-content: flex-end;
}

.lopdp-mini-prefs {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--lopdp-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lopdp-mini-cat {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 12.5px !important;
    color: var(--lopdp-fg) !important;
    cursor: pointer;
    font-family: var(--lopdp-font) !important;
}
.lopdp-mini-cat input[type=checkbox] {
    accent-color: var(--lopdp-fg);
    width: 14px;
    height: 14px;
    margin: 0 !important;
}
.lopdp-mini-cat em { color: var(--lopdp-muted); font-style: normal; font-size: 11.5px; }
.lopdp-mini-prefs-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 6px;
}

/* ============================================================
 * BOTONES — blindados contra herencia.
 * ============================================================ */
.lopdp-btn,
button.lopdp-btn,
#lopdp-cookie-banner .lopdp-btn,
#lopdp-consent-popup .lopdp-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 7px 12px !important;
    min-height: 32px;
    border-radius: 6px !important;
    border: 1px solid transparent !important;
    cursor: pointer;
    font-family: var(--lopdp-font) !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    background-image: none !important;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
    margin: 0 !important;
    height: auto !important;
    width: auto !important;
    min-width: 0 !important;
    text-align: center;
    vertical-align: middle;
    appearance: none !important;
    -webkit-appearance: none !important;
}
.lopdp-btn-solid,
button.lopdp-btn-solid,
#lopdp-cookie-banner .lopdp-btn-solid,
#lopdp-consent-popup .lopdp-btn-solid {
    background: var(--lopdp-fg) !important;
    color: var(--lopdp-bg) !important;
    border-color: var(--lopdp-fg) !important;
}
.lopdp-btn-solid:hover,
button.lopdp-btn-solid:hover {
    background: #27272a !important;
    border-color: #27272a !important;
    color: var(--lopdp-bg) !important;
}
.lopdp-btn-ghost,
button.lopdp-btn-ghost,
#lopdp-cookie-banner .lopdp-btn-ghost,
#lopdp-consent-popup .lopdp-btn-ghost {
    background: transparent !important;
    color: var(--lopdp-fg) !important;
    border-color: var(--lopdp-border) !important;
}
.lopdp-btn-ghost:hover,
button.lopdp-btn-ghost:hover {
    background: var(--lopdp-surface-2) !important;
    color: var(--lopdp-fg) !important;
    border-color: var(--lopdp-muted) !important;
}
#lopdp-cookie-banner.lopdp-theme-dark .lopdp-btn-solid {
    background: var(--lopdp-bg) !important;
    color: var(--lopdp-fg) !important;
    border-color: var(--lopdp-bg) !important;
}
#lopdp-cookie-banner.lopdp-theme-dark .lopdp-btn-ghost {
    background: transparent !important;
    color: var(--lopdp-bg) !important;
    border-color: #52525b !important;
}
.lopdp-btn:focus-visible {
    outline: 2px solid currentColor !important;
    outline-offset: 2px !important;
}

/* Alias compatibles con marcado anterior. */
.lopdp-btn-primary { background: var(--lopdp-fg) !important; color: var(--lopdp-bg) !important; border-color: var(--lopdp-fg) !important; }
.lopdp-btn-secondary { background: transparent !important; color: var(--lopdp-fg) !important; border-color: var(--lopdp-border) !important; }

/* ============================================================
 * POPUP grande (opcional, desactivado por defecto desde v1.0.4).
 * Solo se renderiza si el admin lo activa explícitamente.
 * ============================================================ */
#lopdp-consent-popup.lopdp-toast {
    position: fixed !important;
    left: 16px;
    bottom: 16px;
    z-index: 999999;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: var(--lopdp-bg) !important;
    color: var(--lopdp-fg) !important;
    border: 1px solid var(--lopdp-border);
    border-radius: var(--lopdp-radius);
    box-shadow: var(--lopdp-shadow);
    padding: 0;
    margin: 0;
    animation: lopdp-mini-in 220ms cubic-bezier(.16,1,.3,1);
}
#lopdp-consent-popup.lopdp-toast[hidden] { display: none !important; }
.lopdp-toast-inner { position: relative; padding: 16px 16px 14px; }
.lopdp-toast-close {
    position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
    background: transparent !important; border: 0 !important; cursor: pointer;
    color: var(--lopdp-muted) !important; border-radius: 6px;
    padding: 0 !important; appearance: none !important; -webkit-appearance: none !important;
    display: inline-flex !important; align-items: center; justify-content: center;
    box-shadow: none !important;
}
.lopdp-toast-close:hover { background: var(--lopdp-surface-2) !important; color: var(--lopdp-fg) !important; }
.lopdp-toast-title { font-size: 13.5px !important; font-weight: 600 !important; margin: 0 24px 4px 0 !important; color: var(--lopdp-fg) !important; font-family: var(--lopdp-font) !important; }
.lopdp-toast-body { font-size: 12.5px !important; line-height: 1.5 !important; color: var(--lopdp-muted) !important; margin: 0 0 10px !important; font-family: var(--lopdp-font) !important; }
.lopdp-toast-check { display: flex !important; gap: 8px; align-items: flex-start; background: var(--lopdp-surface); border: 1px solid var(--lopdp-border); border-radius: 7px; padding: 9px 10px; margin: 0 0 4px !important; font-size: 12px !important; line-height: 1.4 !important; color: var(--lopdp-fg) !important; cursor: pointer; }
.lopdp-toast-check input { margin: 2px 0 0 !important; width: 13px; height: 13px; accent-color: var(--lopdp-fg); }
.lopdp-toast-check a { color: var(--lopdp-fg) !important; text-decoration: underline !important; }
.lopdp-toast-hint { margin: 6px 2px 0 !important; font-size: 12px !important; color: var(--lopdp-fg) !important; }
.lopdp-toast-actions { display: flex !important; gap: 6px; justify-content: flex-end; margin-top: 12px; }

/* ============================================================
 * SHORTCODES en formularios.
 * ============================================================ */
.lopdp-consent-field {
    margin: 12px 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--lopdp-fg);
    font-family: var(--lopdp-font);
}
.lopdp-consent-field label {
    display: flex; gap: 9px; align-items: flex-start; cursor: pointer;
}
.lopdp-consent-field input[type=checkbox] {
    margin-top: 3px;
    accent-color: var(--lopdp-fg);
    flex-shrink: 0;
}
.lopdp-consent-field a { color: var(--lopdp-fg); text-decoration: underline; }
.lopdp-consent-sensitive {
    background: var(--lopdp-surface);
    border: 1px solid var(--lopdp-border);
    border-left: 3px solid var(--lopdp-fg);
    padding: 12px 14px;
    border-radius: 8px;
}

/* ============================================================
 * FORMULARIO ARCO+.
 * ============================================================ */
.lopdp-rights-form { font-family: var(--lopdp-font); color: var(--lopdp-fg); }
.lopdp-rights-form p { margin: 10px 0; }
.lopdp-rights-form label { display: block; font-weight: 500; margin-bottom: 4px; color: var(--lopdp-fg); }
.lopdp-rights-form input,
.lopdp-rights-form select,
.lopdp-rights-form textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--lopdp-border);
    border-radius: 6px;
    font: inherit;
    background: #fff;
    color: var(--lopdp-fg);
}
.lopdp-rights-form input:focus,
.lopdp-rights-form select:focus,
.lopdp-rights-form textarea:focus {
    outline: 2px solid var(--lopdp-fg);
    outline-offset: 1px;
    border-color: var(--lopdp-fg);
}
.lopdp-rights-feedback { margin-top: 10px; font-size: 13px; }
.lopdp-rights-feedback.success,
.lopdp-rights-feedback.error { color: var(--lopdp-fg); font-weight: 500; }

.lopdp-manage-cookies-btn {
    background: transparent !important;
    border: 1px solid var(--lopdp-border) !important;
    color: var(--lopdp-fg) !important;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font: inherit;
    font-family: var(--lopdp-font) !important;
}
.lopdp-manage-cookies-btn:hover { background: var(--lopdp-surface-2) !important; }

/* ============================================================
 * RESPONSIVE.
 * ============================================================ */
@media (max-width: 640px) {
    #lopdp-cookie-banner.lopdp-mini,
    #lopdp-consent-popup.lopdp-toast {
        left: 12px !important;
        right: 12px !important;
        bottom: 12px !important;
        width: auto !important;
        max-width: none !important;
        transform: none !important;
    }
}

@keyframes lopdp-mini-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
#lopdp-cookie-banner.lopdp-pos-bottom { animation-name: lopdp-mini-in-center; }
@keyframes lopdp-mini-in-center {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) {
    #lopdp-cookie-banner.lopdp-mini,
    #lopdp-consent-popup.lopdp-toast { animation: none !important; }
    .lopdp-btn { transition: none !important; }
}
