/* ==========================================================================
   Premora Cookie Consent Banner + Preference Center
   File: assets/css/cookie-consent.css
   Uses the site's existing CSS custom properties (set by includes/theme-css.php)
   so it always matches the current admin-configured brand theme. No new
   colors are introduced - only var() references with safe fallbacks.
   ========================================================================== */

#pts-cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 99998;
    max-width: 620px;
    margin: 0 auto;
    background: var(--home-surface-color, #ffffff);
    color: var(--text-color, #586174);
    border: 1px solid var(--home-border-color, #dce5fc);
    border-radius: var(--border-radius, 12px);
    box-shadow: var(--box-shadow, 0 10px 30px rgba(16,24,40,0.08));
    padding: 20px 22px;
    font-family: var(--font-family, "Inter", Arial, sans-serif);
    display: none;
}
#pts-cookie-banner.pts-cookie-visible { display: block; }
#pts-cookie-banner p {
    margin: 0 0 14px 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-color, #586174);
}
#pts-cookie-banner a {
    color: var(--link-color, #2151e0);
    text-decoration: underline;
}
.pts-cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.pts-cookie-btn {
    border: 1px solid transparent;
    border-radius: var(--button-radius, 8px);
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity .15s ease;
}
.pts-cookie-btn:hover { opacity: .88; }
.pts-cookie-btn-accept {
    background: var(--primary-color, #0758E8);
    color: #ffffff;
}
.pts-cookie-btn-reject {
    background: transparent;
    color: var(--heading-color, #172033);
    border-color: var(--home-border-color, #dce5fc);
}
.pts-cookie-btn-manage {
    background: transparent;
    color: var(--link-color, #2151e0);
    border-color: transparent;
    text-decoration: underline;
    padding-left: 4px;
    padding-right: 4px;
}

/* Preference modal */
#pts-cookie-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 21, 92, 0.45);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
#pts-cookie-modal-overlay.pts-cookie-visible { display: flex; }
#pts-cookie-modal {
    background: var(--home-surface-color, #ffffff);
    color: var(--text-color, #586174);
    border-radius: var(--border-radius, 12px);
    box-shadow: var(--box-shadow, 0 10px 30px rgba(16,24,40,0.08));
    max-width: 560px;
    width: 100%;
    max-height: 86vh;
    overflow-y: auto;
    padding: 26px 26px 22px;
    font-family: var(--font-family, "Inter", Arial, sans-serif);
}
#pts-cookie-modal h2 {
    margin: 0 0 6px;
    font-size: 19px;
    font-family: var(--heading-font, "Manrope", Arial, sans-serif);
    color: var(--heading-color, #172033);
}
#pts-cookie-modal > p {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-color, #586174);
    margin: 0 0 18px;
}
.pts-cookie-category {
    border: 1px solid var(--home-border-color, #dce5fc);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.pts-cookie-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.pts-cookie-category-head strong {
    font-size: 14.5px;
    color: var(--heading-color, #172033);
}
.pts-cookie-category p {
    margin: 8px 0 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-color, #586174);
}
.pts-cookie-locked-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--premora-cyan, #08BDE1);
}

/* Toggle switch */
.pts-cookie-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex: 0 0 42px;
}
.pts-cookie-switch input { opacity: 0; width: 0; height: 0; }
.pts-cookie-switch-slider {
    position: absolute;
    inset: 0;
    background: var(--home-border-color, #dce5fc);
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s ease;
}
.pts-cookie-switch-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform .15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.pts-cookie-switch input:checked + .pts-cookie-switch-slider {
    background: var(--primary-color, #0758E8);
}
.pts-cookie-switch input:checked + .pts-cookie-switch-slider::before {
    transform: translateX(18px);
}
.pts-cookie-switch input:disabled + .pts-cookie-switch-slider {
    cursor: not-allowed;
}

.pts-cookie-modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.pts-cookie-modal-links {
    margin-top: 14px;
    font-size: 12px;
}
.pts-cookie-modal-links a {
    color: var(--link-color, #2151e0);
    text-decoration: underline;
    margin-right: 14px;
}
#pts-cookie-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-color, #586174);
}
#pts-cookie-modal { position: relative; }

/* "Cookie Settings" reopen link, used in footer */
.pts-cookie-reopen-link {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    text-decoration: none;
}

@media (max-width: 576px) {
    #pts-cookie-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 16px 16px;
    }
    .pts-cookie-actions { flex-direction: column; }
    .pts-cookie-actions .pts-cookie-btn { width: 100%; text-align: center; }
    #pts-cookie-modal { padding: 22px 18px 18px; }
}
