/**
 * WSF Cookie consent — storefront styles (colours via CSS variables from admin).
 */

.wsf-cc {
    position: fixed;
    z-index: 100000;
    pointer-events: none;
}

.wsf-cc > * {
    pointer-events: auto;
}

.wsf-cc--bottom {
    left: 50%;
    right: auto;
    bottom: 1rem;
    transform: translateX(-50%);
    width: min(520px, calc(100vw - 2rem));
    max-width: min(520px, calc(100vw - 2rem));
}

.wsf-cc--bottom-left {
    left: 1rem;
    bottom: 1rem;
    width: min(520px, calc(100vw - 2rem));
    max-width: min(520px, calc(100vw - 2rem));
}

.wsf-cc--bottom-right {
    right: 1rem;
    bottom: 1rem;
    width: min(520px, calc(100vw - 2rem));
    max-width: min(520px, calc(100vw - 2rem));
}

.wsf-cc__banner {
    position: relative;
    background: var(--wsf-cc-banner-bg, #fff);
    color: var(--wsf-cc-banner-text, #1a1d21);
    border: 1px solid var(--wsf-cc-banner-border, #1a1d21);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.wsf-cc__dismiss {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 2;
    border: 0;
    background: transparent;
    color: var(--wsf-cc-banner-muted, #5c6370);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.15rem 0.4rem;
}

.wsf-cc__dismiss:hover,
.wsf-cc__dismiss:focus {
    color: var(--wsf-cc-banner-text, #1a1d21);
}

.wsf-cc__banner-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 1.1rem 1.15rem 1rem;
}

.wsf-cc__title {
    display: block;
    padding-right: 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--wsf-cc-banner-text, #1a1d21);
}

.wsf-cc__body {
    margin: 0;
    color: var(--wsf-cc-banner-muted, #5c6370);
    font-size: 0.875rem;
    line-height: 1.5;
}

.wsf-cc__link {
    display: inline-block;
    margin-top: 0.25rem;
    color: var(--wsf-cc-accent, #2563eb);
    font-size: 0.875rem;
    text-decoration: underline;
}

.wsf-cc__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.15rem;
}

.wsf-cc__btn {
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
    text-align: center;
}

.wsf-cc__btn--action {
    background: var(--wsf-cc-btn-primary-bg, #90c163);
    color: var(--wsf-cc-btn-primary-text, #1a1d21);
    border-color: var(--wsf-cc-btn-secondary-border, #1a1d21);
}

.wsf-cc__btn--action:hover,
.wsf-cc__btn--action:focus {
    filter: brightness(0.96);
}

.wsf-cc__btn--primary {
    background: var(--wsf-cc-btn-primary-bg, #90c163);
    color: var(--wsf-cc-btn-primary-text, #1a1d21);
    border-color: var(--wsf-cc-btn-secondary-border, #1a1d21);
}

.wsf-cc__btn--secondary {
    background: var(--wsf-cc-btn-secondary-bg, #90c163);
    color: var(--wsf-cc-btn-secondary-text, #1a1d21);
    border-color: var(--wsf-cc-btn-secondary-border, #1a1d21);
}

.wsf-cc__btn--ghost {
    background: transparent;
    color: var(--wsf-cc-banner-muted, #5c6370);
    border-color: transparent;
    text-decoration: underline;
}

.wsf-cc__modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.wsf-cc__modal-panel {
    width: min(100%, 520px);
    max-height: min(90vh, 640px);
    overflow: auto;
    background: var(--wsf-cc-modal-bg, #fff);
    color: var(--wsf-cc-modal-text, #1a1d21);
    border: 1px solid var(--wsf-cc-banner-border, #1a1d21);
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.wsf-cc__modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.wsf-cc__modal-head h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.wsf-cc__close {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--wsf-cc-banner-muted, #5c6370);
    padding: 0.15rem 0.35rem;
}

.wsf-cc__modal-body {
    padding: 1rem 1.25rem;
}

.wsf-cc__toggle-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.wsf-cc__toggle-row:last-of-type {
    border-bottom: 0;
}

.wsf-cc__toggle-copy strong {
    display: block;
    margin-bottom: 0.2rem;
}

.wsf-cc__toggle-copy p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--wsf-cc-modal-muted, #5c6370);
    line-height: 1.45;
}

.wsf-cc__always {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--wsf-cc-accent, #2563eb);
}

.wsf-cc__switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.wsf-cc__switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wsf-cc__switch-ui {
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: var(--wsf-cc-toggle-off, #c5cad3);
    position: relative;
    transition: background 0.15s ease;
}

.wsf-cc__switch-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.wsf-cc__switch input:checked + .wsf-cc__switch-ui {
    background: var(--wsf-cc-toggle-on, #2563eb);
}

.wsf-cc__switch input:checked + .wsf-cc__switch-ui::after {
    transform: translateX(20px);
}

.wsf-cc__switch input:disabled + .wsf-cc__switch-ui {
    opacity: 0.65;
}

.wsf-cc__privacy {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
}

.wsf-cc__privacy a {
    color: var(--wsf-cc-accent, #2563eb);
}

.wsf-cc__modal-foot {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.wsf-cc__modal-foot .wsf-cc__btn--primary {
    color: var(--wsf-cc-btn-primary-text, #1a1d21);
}

.wsf-cc__modal-foot .wsf-cc__btn--secondary {
    color: var(--wsf-cc-btn-secondary-text, #1a1d21);
    border-color: var(--wsf-cc-btn-secondary-border, #1a1d21);
    background: var(--wsf-cc-btn-secondary-bg, #90c163);
}

html.wsf-cc-modal-open {
    overflow: hidden;
}

.wsf-footer__menu .wsf-cc-open-prefs {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}

.wsf-footer__menu .wsf-cc-open-prefs:hover {
    text-decoration: underline;
}

.wsf-cc-preview-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100001;
    padding: 8px 16px;
    background: #dba617;
    color: #1d2327;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

body.admin-bar .wsf-cc-preview-bar {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .wsf-cc-preview-bar {
        top: 46px;
    }
}

@media (max-width: 640px) {
    .wsf-cc--bottom,
    .wsf-cc--bottom-left,
    .wsf-cc--bottom-right {
        left: 1rem;
        right: 1rem;
        width: auto;
        max-width: none;
        transform: none;
    }

    .wsf-cc__actions {
        grid-template-columns: 1fr;
    }
}
