/* uzicredenza.com — Cookie Consent Banner & Preferences Modal */

/* ── Banner ── */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 24px rgba(0,0,0,.1);
    padding: 1rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#cookie-banner.cb-visible  { transform: translateY(0); }
#cookie-banner.cb-hide     { transform: translateY(110%); transition: transform 0.3s ease-in; }

.cb-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.cb-left {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
    min-width: 260px;
}
.cb-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1.4; }
.cb-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cb-text strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}
.cb-text span {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.5;
}
.cb-link {
    color: #1a56db;
    text-decoration: underline;
    margin-left: 4px;
    font-size: 0.8rem;
}
.cb-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.cb-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.15s;
}
.cb-btn--primary {
    background: #1db954;
    color: #fff;
}
.cb-btn--primary:hover { background: #17a349; }
.cb-btn--secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.cb-btn--secondary:hover { background: #e2e8f0; }
.cb-btn--ghost {
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.cb-btn--ghost:hover { background: #f8fafc; color: #334155; }

/* ── Preferences Modal ── */
#cookie-prefs {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
#cookie-prefs.cp-visible {
    opacity: 1;
    pointer-events: all;
}

.cp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: -1;
}
.cp-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
#cookie-prefs.cp-visible .cp-modal {
    transform: translateY(0) scale(1);
}

.cp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}
.cp-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.cp-close {
    background: #f1f5f9;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.cp-close:hover { background: #e2e8f0; color: #0f172a; }

.cp-body { padding: 0.5rem 0; }

.cp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}
.cp-row:hover { background: #fafafa; }
.cp-row:last-child { border-bottom: none; }
.cp-row-info { flex: 1; }
.cp-row-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 2px;
}
.cp-row-desc {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.5;
}

/* Toggle "Always on" */
.cp-toggle {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.cp-toggle--on       { background: #dcfce7; color: #166534; }
.cp-toggle--disabled { cursor: not-allowed; opacity: 0.8; }

/* iOS-style toggle switch */
.cp-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}
.cp-switch input { opacity: 0; width: 0; height: 0; }
.cp-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: background 0.2s;
}
.cp-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.cp-switch input:checked + .cp-slider { background: #1db954; }
.cp-switch input:checked + .cp-slider::before { transform: translateX(20px); }
.cp-switch input:focus-visible + .cp-slider {
    outline: 2px solid #1a56db;
    outline-offset: 2px;
}

.cp-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.cp-btn {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.15s;
}
.cp-btn--primary {
    background: #1db954;
    color: #fff;
}
.cp-btn--primary:hover { background: #17a349; }
.cp-btn--secondary {
    background: #fff;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.cp-btn--secondary:hover { background: #f1f5f9; }

/* ── Responsive ── */
@media (max-width: 700px) {
    .cb-inner   { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .cb-actions { width: 100%; justify-content: flex-end; }
    .cp-modal   { border-radius: 14px 14px 0 0; position: fixed; bottom: 0; max-width: 100%; }
    #cookie-prefs { align-items: flex-end; padding: 0; }
}
