/* PCM Public Popup Styles */
#pcm-consent-popup {
    position: fixed;
    z-index: 999999;
    display: none;
}

.pcm-overlay {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.pcm-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.pcm-overlay .pcm-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 600px;
    width: 90%;
}

.pcm-quiet {
    max-width: 400px;
}

.pcm-pos-bottom-right {
    bottom: 20px;
    right: 20px;
}

.pcm-pos-bottom-left {
    bottom: 20px;
    left: 20px;
}

.pcm-pos-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pcm-modal {
    background: var(--pcm-bg, #fff);
    color: var(--pcm-text, #333);
    font-family: var(--pcm-font-family, inherit);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.pcm-text {
    font-size: var(--pcm-text-size, 15px);
    line-height: 1.6;
    margin-bottom: 16px;
}

.pcm-link {
    color: var(--pcm-link, #0073aa);
    text-decoration: underline;
    display: inline-block;
    margin-bottom: 16px;
    font-size: var(--pcm-link-size, 15px);
}

.pcm-link:hover {
    text-decoration: none;
}

.pcm-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pcm-btn {
    background: var(--pcm-btn-bg, #0073aa);
    color: var(--pcm-btn-text, #fff);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: var(--pcm-btn-size, 14px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pcm-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.pcm-btn-accept {
    background: var(--pcm-accept-bg, var(--pcm-btn-bg, #28a745));
    color: var(--pcm-accept-text, var(--pcm-btn-text, #fff));
}

.pcm-btn-essential {
    background: var(--pcm-essential-bg, var(--pcm-btn-bg, #ffc107));
    color: var(--pcm-essential-text, var(--pcm-btn-text, #000));
}

.pcm-btn-decline {
    background: var(--pcm-decline-bg, var(--pcm-btn-bg, #dc3545));
    color: var(--pcm-decline-text, var(--pcm-btn-text, #fff));
}

@keyframes pcmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pcmSlideUp {
    from {
        transform: translate(-50%, 20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

#pcm-consent-popup {
    animation: pcmFadeIn 0.3s ease-out;
}

.pcm-overlay .pcm-modal {
    animation: pcmSlideUp 0.3s ease-out;
}

@media (max-width: 600px) {
    .pcm-overlay .pcm-modal {
        width: 95%;
        max-width: none;
    }
    
    .pcm-quiet {
        left: 10px !important;
        right: 10px !important;
        max-width: none !important;
    }
    
    .pcm-actions {
        flex-direction: column;
    }
    
    .pcm-btn {
        width: 100%;
    }
}

/* =============================================================================
 * v3.1.0-alpha2: Click-to-load placeholders for blocked iframes (YouTube,
 * Vimeo, Maps, Twitter/X, Instagram, Facebook, etc.). Loaded on every page
 * regardless of consent state so the visitor always has a labeled affordance.
 * =========================================================================*/

.pcm-ctl-wrap {
    position: relative;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 10px;
    overflow: hidden;
    color: #f8fafc;
    width: 100%;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    direction: rtl;
}

.pcm-ctl-wrap iframe {
    display: none;
}

.pcm-ctl-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px 28px;
    max-width: 90%;
    text-align: center;
}

.pcm-ctl-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 28px 28px;
}

/* Per-vendor accent colors. SVG-as-data-URL icons keep CSS self-contained. */
.pcm-ctl-youtube .pcm-ctl-icon  { background-color: #ff0000; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M21.582 6.186a2.506 2.506 0 0 0-1.768-1.768C18.254 4 12 4 12 4s-6.254 0-7.814.418A2.506 2.506 0 0 0 2.418 6.186C2 7.746 2 12 2 12s0 4.254.418 5.814a2.506 2.506 0 0 0 1.768 1.768C5.746 20 12 20 12 20s6.254 0 7.814-.418a2.506 2.506 0 0 0 1.768-1.768C22 16.254 22 12 22 12s0-4.254-.418-5.814zM10 15V9l5.196 3L10 15z'/></svg>"); }
.pcm-ctl-vimeo .pcm-ctl-icon    { background-color: #1ab7ea; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M22.396 7.164c-.093 2.026-1.508 4.802-4.244 8.328C15.323 19.175 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.082-3.36C6.541 13.515 5.661 8 4.59 8c-.122 0-.55.257-1.281.77L2.541 7.616a285.077 285.077 0 0 0 3.176-2.83C7.155 3.535 8.234 2.851 8.95 2.785c1.69-.163 2.731.995 3.123 3.473.422 2.675.715 4.337.879 4.987.487 2.215 1.023 3.322 1.605 3.322.452 0 1.13-.714 2.035-2.142.904-1.428 1.388-2.515 1.452-3.262.13-1.231-.357-1.848-1.452-1.848-.515 0-1.045.117-1.59.351 1.054-3.45 3.066-5.127 6.038-5.031 2.204.063 3.243 1.49 3.119 4.276z'/></svg>"); }
.pcm-ctl-maps .pcm-ctl-icon     { background-color: #4285f4; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 0 1 0-5 2.5 2.5 0 0 1 0 5z'/></svg>"); }
.pcm-ctl-twitter .pcm-ctl-icon  { background-color: #000000; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/></svg>"); }
.pcm-ctl-instagram .pcm-ctl-icon{ background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 0 0 0-12.324zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm6.406-11.845a1.44 1.44 0 1 0 0 2.881 1.44 1.44 0 0 0 0-2.881z'/></svg>"); }
.pcm-ctl-facebook .pcm-ctl-icon { background-color: #1877f2; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z'/></svg>"); }
.pcm-ctl-wistia .pcm-ctl-icon, .pcm-ctl-soundcloud .pcm-ctl-icon {
    background-color: #94a3b8;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M8 5v14l11-7z'/></svg>");
}

.pcm-ctl-msg {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.4;
}

.pcm-ctl-msg strong {
    font-size: 17px;
    font-weight: 600;
}

.pcm-ctl-msg span {
    font-size: 13px;
    opacity: 0.8;
}

.pcm-ctl-btn {
    background: #f8fafc;
    color: #0f172a;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    min-height: 40px;
}

.pcm-ctl-btn:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.pcm-ctl-btn:active {
    transform: translateY(0);
}

.pcm-ctl-btn:focus-visible {
    outline: 2px solid #f8fafc;
    outline-offset: 3px;
}

@media (max-width: 600px) {
    .pcm-ctl-wrap { min-height: 180px; }
    .pcm-ctl-icon { width: 44px; height: 44px; background-size: 22px 22px; }
    .pcm-ctl-msg strong { font-size: 15px; }
}

/* When the popup itself is visible, leave space for the page underneath. */
@media (prefers-reduced-motion: reduce) {
    .pcm-ctl-btn { transition: none; }
}

/* =============================================================================
 * v3.1.0-alpha3: Category-toggles panel (the "Customize" expander).
 *
 * Hidden by default. Becomes visible when .pcm-categories.pcm-open is set
 * by pcm-public.js, with a smooth slide-down animation.
 * =========================================================================*/

.pcm-btn-customize {
    background: transparent !important;
    color: var(--pcm-link, #0073aa) !important;
    border: 1px solid currentColor !important;
    font-weight: 500 !important;
}
.pcm-btn-customize:hover { opacity: 0.85; }

.pcm-categories {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.08);
    direction: rtl;
    text-align: right;
    max-height: 60vh;
    overflow-y: auto;
}
.pcm-categories.pcm-open {
    display: block;
    animation: pcmCategoriesIn 0.25s ease-out;
}

@keyframes pcmCategoriesIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pcm-cat-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--pcm-text, #333);
}

.pcm-cat-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
}
.pcm-cat-row:last-of-type { border-bottom: none; }
.pcm-cat-row.pcm-cat-required { cursor: default; }

.pcm-cat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.pcm-cat-info strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--pcm-text, #333);
    line-height: 1.3;
}
.pcm-cat-info span {
    font-size: 12px;
    color: rgba(0,0,0,0.6);
    line-height: 1.45;
}

/* Toggle switch (CSS-only). RTL-aware: slider moves to LEFT when checked. */
.pcm-cat-toggle {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    align-self: center;
}
.pcm-cat-cb {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}
.pcm-cat-cb:disabled { cursor: not-allowed; }
.pcm-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: background 0.2s ease;
}
.pcm-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.pcm-cat-cb:checked + .pcm-slider {
    background: var(--pcm-btn-bg, #0073aa);
}
.pcm-cat-cb:checked + .pcm-slider::before {
    transform: translateX(-18px); /* RTL: slide LEFT */
}
.pcm-cat-cb:focus-visible + .pcm-slider {
    outline: 2px solid var(--pcm-btn-bg, #0073aa);
    outline-offset: 3px;
}
.pcm-cat-cb:disabled + .pcm-slider {
    opacity: 0.6;
    background: #94a3b8;
}

.pcm-cat-actions {
    margin-top: 16px;
    display: flex;
    justify-content: stretch;
}
.pcm-btn-save-choices {
    flex: 1;
    background: var(--pcm-btn-bg, #0073aa);
    color: var(--pcm-btn-text, #fff);
}

@media (max-width: 600px) {
    .pcm-categories { max-height: 50vh; }
    .pcm-cat-row { padding: 10px 0; gap: 10px; }
    .pcm-cat-info strong { font-size: 13px; }
    .pcm-cat-info span { font-size: 11px; }
}

/* =============================================================================
 * v3.1.0-alpha3: Floating Privacy Pill — persistent re-entry to consent UI.
 * Required by Tikun 13 + GDPR (right to withdraw at any time).
 *
 * Shown only AFTER initial consent (i.e., the popup is hidden but the user
 * may want to come back). Position configurable; default bottom-left.
 * =========================================================================*/

/*
 * v4.0.1 hotfix: !important on every visual property of the pill.
 * Themes (Astra, OceanWP, GeneratePress, Hello Elementor, many builders)
 * apply blanket `button { ... }` styles that override our defaults:
 *   - width: auto    → pill stretches to text content (becomes an oval)
 *   - border-radius: 6px → loses its circle shape
 *   - background: gradient → loses its dark legible bg
 *   - padding: 12px 24px → bursts the 44×44 box
 *   - font-family, line-height, text-transform → render artefacts
 * The pill must be perfectly round at exactly 44×44 in every theme; we cannot
 * rely on cascade order alone. !important is intentional and scoped to this
 * one ID — it does NOT leak into the popup or any other plugin styles.
 */
#pcm-privacy-pill {
    position: fixed !important;
    z-index: 999998 !important;
    background: rgba(15, 23, 42, 0.92) !important;
    background-image: none !important;
    color: #f8fafc !important;
    border: none !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25) !important;
    transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease !important;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
    font-size: 0 !important;       /* kill any inherited line-height that would push the SVG */
    line-height: 1 !important;
    text-transform: none !important;
    text-decoration: none !important;
    text-shadow: none !important;
    letter-spacing: normal !important;
    box-sizing: border-box !important;
    direction: rtl;
    appearance: none !important;
    -webkit-appearance: none !important;
    outline: none;
    opacity: 1 !important;
    transform: none;
    overflow: hidden !important;
}
#pcm-privacy-pill.pcm-pill-visible { display: flex !important; }
#pcm-privacy-pill:hover {
    transform: scale(1.08) !important;
    background: rgba(15, 23, 42, 1) !important;
}
#pcm-privacy-pill:focus-visible {
    outline: 2px solid #f8fafc !important;
    outline-offset: 3px !important;
}
#pcm-privacy-pill svg {
    width: 22px !important;
    height: 22px !important;
    display: block !important;
    fill: currentColor !important;
    stroke: currentColor !important;
}

/* Positions. JS adds the appropriate class. */
#pcm-privacy-pill.pcm-pill-bl { bottom: 16px !important; left:  16px !important; top: auto !important; right: auto !important; }
#pcm-privacy-pill.pcm-pill-br { bottom: 16px !important; right: 16px !important; top: auto !important; left: auto !important; }
#pcm-privacy-pill.pcm-pill-tl { top:    16px !important; left:  16px !important; bottom: auto !important; right: auto !important; }
#pcm-privacy-pill.pcm-pill-tr { top:    16px !important; right: 16px !important; bottom: auto !important; left: auto !important; }

@media (max-width: 600px) {
    #pcm-privacy-pill.pcm-pill-bl { bottom: 12px !important; left:  12px !important; }
    #pcm-privacy-pill.pcm-pill-br { bottom: 12px !important; right: 12px !important; }
    #pcm-privacy-pill.pcm-pill-tl { top:    12px !important; left:  12px !important; }
    #pcm-privacy-pill.pcm-pill-tr { top:    12px !important; right: 12px !important; }
}

/* =============================================================================
 * v4.0.0-alpha4: Footer text-link fallback for when the floating pill is
 * disabled. Renders as a small, unobtrusive inline link that visitors can
 * find by scrolling to the bottom of the page. Preserves the legal
 * right-to-withdraw without the visible floating button.
 *
 * The link is always visible — it's a static text element, not a UI overlay.
 * It positions itself at the very bottom of the page via fixed positioning
 * but with very low z-index so it doesn't conflict with theme footers.
 * =========================================================================*/

#pcm-privacy-link.pcm-privacy-link {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99990;  /* below modals but above content */
    background: rgba(15, 23, 42, 0.75);
    color: #f8fafc;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    text-decoration: none;
    line-height: 1.4;
    direction: rtl;
    opacity: 0.7;
    transition: opacity 0.2s ease, background 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#pcm-privacy-link.pcm-privacy-link:hover,
#pcm-privacy-link.pcm-privacy-link:focus-visible {
    opacity: 1;
    background: rgba(15, 23, 42, 0.95);
    color: #f8fafc;
    text-decoration: none;
    outline: none;
}

#pcm-privacy-link.pcm-privacy-link:focus-visible {
    outline: 2px solid #f8fafc;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    #pcm-privacy-link.pcm-privacy-link { bottom: 4px; font-size: 10px; padding: 3px 10px; }
}
