/* CookieDZ — Diego Fernando Zapata — diegozapatadz.com */

/* Aislar el banner/modal de resets globales de temas y page builders
   (Elementor, Divi, etc. suelen forzar box-sizing y márgenes en *). */
#cdz-banner, #cdz-banner *,
#cdz-modal,  #cdz-modal * {
    box-sizing: border-box;
}

/* ── Banner ─────────────────────────────────────────── */
#cdz-banner {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2147483000 !important;
    background: var(--cdz-bg, #0f172a);
    color: var(--cdz-text, #e2e8f0);
    border-top: 2px solid var(--cdz-accent, #2563eb);
    padding: 16px 20px 10px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    transform: translateY(110%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#cdz-banner.cdz-visible {
    transform: translateY(0);
}

#cdz-banner.cdz-top {
    bottom: auto;
    top: 0;
    border-top: none;
    border-bottom: 2px solid var(--cdz-accent, #2563eb);
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    transform: translateY(-110%);
}

#cdz-banner.cdz-top.cdz-visible {
    transform: translateY(0);
}

.cdz-banner-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.cdz-banner-text {
    flex: 1;
    min-width: 220px;
}

.cdz-banner-text p {
    margin: 0;
    color: var(--cdz-text, #e2e8f0);
    opacity: 0.85;
}

.cdz-link {
    color: var(--cdz-accent, #2563eb);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cdz-link:hover {
    opacity: 0.8;
}

.cdz-banner-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.cdz-credit {
    text-align: center;
    font-size: 11px;
    color: var(--cdz-text, #e2e8f0);
    opacity: 0.35;
    margin: 8px 0 0;
}

/* ── Botones ─────────────────────────────────────────── */
.cdz-btn {
    cursor: pointer;
    border: none;
    border-radius: 6px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
}

.cdz-btn:hover  { opacity: 0.85; }
.cdz-btn:active { transform: scale(0.97); }

.cdz-btn-primary {
    background: var(--cdz-accent, #2563eb);
    color: #fff;
}

.cdz-btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--cdz-text, #e2e8f0);
    border: 1px solid rgba(255,255,255,0.15);
}

.cdz-btn-ghost {
    background: transparent;
    color: var(--cdz-accent, #2563eb);
    border: 1px solid var(--cdz-accent, #2563eb);
}

/* ── Modal ───────────────────────────────────────────── */
#cdz-modal {
    display: none;
    position: fixed !important;
    inset: 0;
    z-index: 2147483001 !important;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#cdz-modal.cdz-open {
    display: flex;
}

.cdz-modal-box {
    background: var(--cdz-bg, #0f172a);
    color: var(--cdz-text, #e2e8f0);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 32px 28px 24px;
    width: 100%;
    max-width: 480px;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.cdz-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--cdz-text, #e2e8f0);
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}

.cdz-modal-close:hover { background: rgba(255,255,255,0.15); }

.cdz-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--cdz-text, #e2e8f0);
}

.cdz-modal-intro {
    font-size: 13px;
    opacity: 0.7;
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ── Filas de cookies ────────────────────────────────── */
.cdz-cookie-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.cdz-cookie-item:last-of-type {
    border-bottom: none;
}

.cdz-cookie-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cdz-cookie-info strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--cdz-text, #e2e8f0);
}

.cdz-cookie-info span {
    font-size: 12px;
    opacity: 0.6;
    line-height: 1.4;
}

/* ── Toggle switch ───────────────────────────────────── */
.cdz-toggle {
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.25s;
}

.cdz-toggle.cdz-toggle-on {
    background: var(--cdz-accent, #2563eb);
}

.cdz-toggle.cdz-toggle-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--cdz-accent, #2563eb);
}

.cdz-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.cdz-toggle.cdz-toggle-on .cdz-toggle-thumb {
    transform: translateX(20px);
}

/* ── Footer del modal ────────────────────────────────── */
.cdz-modal-footer {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.cdz-modal-footer .cdz-btn {
    flex: 1;
    text-align: center;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
    .cdz-banner-inner  { flex-direction: column; align-items: flex-start; }
    .cdz-banner-btns   { width: 100%; }
    .cdz-btn           { flex: 1; text-align: center; }
    .cdz-modal-box     { padding: 24px 16px 20px; border-radius: 12px; }
}
