/* WP Cookie Banner - Public Styles (CookieYes-inspired) */

.wpcb-banner,
.wpcb-modal {
    position: fixed;
    z-index: 999999;
    font-family: var(--wpcb-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    color: var(--wpcb-banner-text, #2d2d2d);
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.wpcb-banner *,
.wpcb-modal * {
    box-sizing: border-box;
}

.wpcb-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--wpcb-overlay-bg, rgba(0,0,0,0.55));
    z-index: -1;
}

/* ─── Banner positioning ─── */
.wpcb-banner.wpcb-pos-bottom-left,
.wpcb-banner.wpcb-pos-bottom-right,
.wpcb-banner.wpcb-pos-center {
    max-width: 440px;
    width: calc(100% - 40px);
}
.wpcb-banner.wpcb-pos-bottom-left  { bottom: 20px; left: 20px; }
.wpcb-banner.wpcb-pos-bottom-right { bottom: 20px; right: 20px; }
.wpcb-banner.wpcb-pos-center {
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

.wpcb-banner.wpcb-pos-bottom { bottom: 0; left: 0; right: 0; }
.wpcb-banner.wpcb-pos-top    { top: 0;    left: 0; right: 0; }

/* ─── Banner inner card ─── */
.wpcb-banner-inner {
    position: relative;
    z-index: 1;
    background: var(--wpcb-banner-bg, #ffffff);
    color: var(--wpcb-banner-text, #2d2d2d);
    padding: 24px 26px 22px;
    border-radius: var(--wpcb-radius, 8px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.06);
    max-width: 100%;
}

.wpcb-banner.wpcb-pos-bottom .wpcb-banner-inner,
.wpcb-banner.wpcb-pos-top    .wpcb-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 0;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.08);
}

.wpcb-banner h2 {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

.wpcb-banner p {
    margin: 0 0 12px;
    line-height: 1.55;
    font-size: 13.5px;
    color: inherit;
}

.wpcb-banner p:last-of-type { margin-bottom: 0; }

.wpcb-policy-links {
    font-size: 12.5px !important;
    margin-top: 8px !important;
}

.wpcb-policy-links a {
    color: var(--wpcb-accept-bg, #0073aa);
    text-decoration: underline;
    margin-right: 14px;
}

/* ─── Buttons row ─── */
.wpcb-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    align-items: center;
}

.wpcb-btn {
    border: 1px solid transparent;
    padding: 9px 16px;
    border-radius: 0;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.2;
    transition: opacity 0.15s, transform 0.05s, background 0.15s, border-color 0.15s;
    font-family: inherit;
    flex: 1;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
}

.wpcb-btn:hover  { opacity: 0.92; }
.wpcb-btn:active { transform: scale(0.98); }

.wpcb-btn-accept {
    background: var(--wpcb-accept-bg, #0073aa);
    color: var(--wpcb-accept-text, #ffffff);
    border-color: var(--wpcb-accept-bg, #0073aa);
    font-weight: 600;
}

.wpcb-btn-reject {
    background: var(--wpcb-reject-bg, #ffffff);
    color: var(--wpcb-reject-text, #4a4a4a);
    border-color: #d0d0d0;
}

.wpcb-btn-pref {
    background: var(--wpcb-pref-bg, transparent);
    color: var(--wpcb-pref-text, #4a4a4a);
    border-color: var(--wpcb-pref-border, transparent);
}

/* ─── Preferences modal ─── */
.wpcb-modal {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wpcb-modal-inner {
    background: var(--wpcb-banner-bg, #ffffff);
    color: var(--wpcb-banner-text, #2d2d2d);
    border-radius: var(--wpcb-radius, 8px);
    max-width: 640px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 12px 48px rgba(0,0,0,0.25);
    position: relative;
    padding: 28px 32px 24px;
}

.wpcb-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}
.wpcb-modal-close:hover { background: #f0f0f0; color: #333; }

.wpcb-modal h2 {
    margin: 0 0 12px;
    font-size: 19px;
    font-weight: 600;
    padding-right: 30px;
    line-height: 1.3;
    color: inherit;
}

.wpcb-modal p {
    margin: 0 0 14px;
    line-height: 1.55;
    font-size: 13.5px;
    color: inherit;
}

/* ─── Categories accordion ─── */
.wpcb-categories {
    margin: 18px 0;
    border-top: 1px solid #e5e5e5;
}

.wpcb-category {
    border-bottom: 1px solid #e5e5e5;
}

.wpcb-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
}

.wpcb-cat-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    min-width: 0;
}

.wpcb-cat-toggle:focus-visible {
    outline: 2px solid var(--wpcb-accept-bg, #0073aa);
    outline-offset: 3px;
    border-radius: 3px;
}

.wpcb-cat-chevron {
    flex-shrink: 0;
    color: #888;
    transition: transform 0.2s ease;
}

.wpcb-cat-toggle[aria-expanded="true"] .wpcb-cat-chevron {
    transform: rotate(90deg);
}

.wpcb-cat-name { color: inherit; }

.wpcb-cat-count {
    color: #888;
    font-weight: 400;
    font-size: 12.5px;
}

.wpcb-cat-always-on {
    font-size: 12px;
    color: var(--wpcb-accept-bg, #0073aa);
    font-weight: 600;
    flex-shrink: 0;
}

.wpcb-cat-body {
    padding: 0 0 16px 22px;
}

.wpcb-cat-desc {
    color: #555;
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 12px !important;
}

/* Cookie info table */
.wpcb-cookie-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 8px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

.wpcb-cookie-info-table thead th {
    text-align: left;
    padding: 8px 10px;
    background: #fafafa;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e8e8e8;
}

.wpcb-cookie-info-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    color: #555;
}

.wpcb-cookie-info-table tbody tr:last-child td { border-bottom: none; }

.wpcb-cookie-info-table strong {
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 12px;
    color: #2d2d2d;
    font-weight: 600;
}

.wpcb-cookie-desc {
    color: #777;
    margin-top: 4px;
    font-size: 11.5px;
    line-height: 1.45;
    font-family: inherit;
    font-weight: normal;
}

/* ─── Toggle switch ─── */
.wpcb-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.wpcb-switch input { opacity: 0; width: 0; height: 0; }

.wpcb-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cfcfcf;
    transition: 0.25s;
    border-radius: 22px;
}

.wpcb-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.25s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.wpcb-switch input:checked + .wpcb-slider {
    background: var(--wpcb-accept-bg, #0073aa);
}

.wpcb-switch input:checked + .wpcb-slider:before {
    transform: translateX(18px);
}

.wpcb-switch input:disabled + .wpcb-slider {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ─── Reopen button ─── */
.wpcb-reopen {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--wpcb-banner-bg, #ffffff);
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 999998;
    color: var(--wpcb-reopen-color, #0073aa);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.2s;
}

.wpcb-reopen svg { display: block; }
.wpcb-reopen:hover { transform: scale(1.08); }

/* ─── Mobile ─── */
@media (max-width: 600px) {
    .wpcb-banner.wpcb-pos-bottom-left,
    .wpcb-banner.wpcb-pos-bottom-right,
    .wpcb-banner.wpcb-pos-center {
        left: 10px;
        right: 10px;
        bottom: 10px;
        top: auto;
        transform: none;
        max-width: none;
        width: auto;
    }

    .wpcb-banner-inner { padding: 20px; }
    .wpcb-modal-inner  { padding: 24px 20px 20px; }

    .wpcb-buttons { flex-direction: column-reverse; }
    .wpcb-btn { width: 100%; flex: 0 0 auto; }

    .wpcb-cookie-info-table thead { display: none; }
    .wpcb-cookie-info-table,
    .wpcb-cookie-info-table tbody,
    .wpcb-cookie-info-table tr,
    .wpcb-cookie-info-table td { display: block; width: 100%; }
    .wpcb-cookie-info-table tr {
        padding: 10px;
        border-bottom: 1px solid #f0f0f0;
    }
    .wpcb-cookie-info-table tr:last-child { border-bottom: none; }
    .wpcb-cookie-info-table td { padding: 2px 0; border: none; }
    .wpcb-cookie-info-table td:nth-child(2):before { content: "Provider: "; color: #999; }
    .wpcb-cookie-info-table td:nth-child(3):before { content: "Duration: "; color: #999; }
}

/* Shortcode-rendered preferences button */
.wpcb-shortcode-btn {
    background: var(--wpcb-accept-bg, #0073aa);
    color: var(--wpcb-accept-text, #ffffff);
    border: 1px solid var(--wpcb-accept-bg, #0073aa);
    padding: 10px 20px;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: opacity 0.15s;
}
.wpcb-shortcode-btn:hover { opacity: 0.92; }
