/**
 * STSPC Cookie Consent — banner styles.
 *
 * Brand colour: #890514
 * Background:   #1c1917 (dark stone) at 95% opacity
 * Text:         #fafaf9
 *
 * @package STSPC_Cookie_Consent
 */

/* ─── Banner wrapper ─────────────────────────────────────── */

.stspc-cb {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 999999;
    background: rgba(28, 25, 23, 0.95);
    color: #fafaf9;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.stspc-cb--bottom {
    bottom: 0;
}

.stspc-cb--top {
    top: 0;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}

/* ─── Inner container ────────────────────────────────────── */

.stspc-cb-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 24px;
    flex-wrap: wrap;
}

.stspc-cb-content {
    flex: 1 1 0%;
    min-width: 240px;
}

.stspc-cb-text {
    margin: 0;
    color: #fafaf9;
}

.stspc-cb-link {
    color: #fafaf9;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.stspc-cb-link:hover {
    opacity: 0.8;
}

/* ─── Action buttons ─────────────────────────────────────── */

.stspc-cb-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.stspc-cb-btn {
    display: inline-block;
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.3;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
}

.stspc-cb-btn:focus-visible {
    outline: 2px solid #fafaf9;
    outline-offset: 2px;
}

/* Accept / Save */
.stspc-cb-btn-accept {
    background: #890514;
    color: #fff;
    border: 2px solid #890514;
}

.stspc-cb-btn-accept:hover {
    background: #a30718;
    border-color: #a30718;
}

/* Reject / Essential Only */
.stspc-cb-btn-reject {
    background: transparent;
    color: #fafaf9;
    border: 2px solid #fafaf9;
}

.stspc-cb-btn-reject:hover {
    background: rgba(250, 250, 249, 0.1);
}

/* Manage — text link style */
.stspc-cb-btn-manage {
    background: transparent;
    color: #fafaf9;
    border: none;
    padding: 10px 8px;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
}

.stspc-cb-btn-manage:hover {
    opacity: 0.75;
}

/* ─── Preferences panel ──────────────────────────────────── */

.stspc-cb-prefs {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 24px;
}

.stspc-cb-prefs-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #fafaf9;
}

/* ─── Category row ───────────────────────────────────────── */

.stspc-cb-category {
    padding: 14px 0;
    border-top: 1px solid rgba(250, 250, 249, 0.12);
}

.stspc-cb-category:last-of-type {
    border-bottom: 1px solid rgba(250, 250, 249, 0.12);
}

.stspc-cb-cat-label {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    cursor: pointer;
}

.stspc-cb-cat-name {
    font-weight: 600;
    font-size: 15px;
    color: #fafaf9;
}

.stspc-cb-cat-desc {
    flex: 1 1 100%;
    font-size: 13px;
    color: rgba(250, 250, 249, 0.7);
    margin-top: 2px;
    padding-left: 56px; /* align with text after toggle */
}

/* ─── Toggle switch ──────────────────────────────────────── */

.stspc-cb-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.stspc-cb-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.stspc-cb-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(250, 250, 249, 0.2);
    border-radius: 24px;
    transition: background 0.25s ease;
    cursor: pointer;
}

.stspc-cb-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fafaf9;
    border-radius: 50%;
    transition: transform 0.25s ease;
}

.stspc-cb-toggle input:checked + .stspc-cb-toggle-slider {
    background: #890514;
}

.stspc-cb-toggle input:checked + .stspc-cb-toggle-slider::after {
    transform: translateX(20px);
}

.stspc-cb-toggle input:disabled + .stspc-cb-toggle-slider {
    opacity: 0.6;
    cursor: default;
}

/* ─── Badge ──────────────────────────────────────────────── */

.stspc-cb-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stspc-cb-badge-required {
    background: #16a34a;
    color: #fff;
}

/* ─── Preferences actions ────────────────────────────────── */

.stspc-cb-prefs-actions {
    margin-top: 20px;
    text-align: right;
}

/* ─── Manage cookies button (shortcode) ──────────────────── */

.stspc-manage-cookies-btn {
    display: inline-block;
    padding: 8px 18px;
    border: 2px solid currentColor;
    border-radius: 6px;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.stspc-manage-cookies-btn:hover {
    opacity: 0.7;
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 768px) {
    .stspc-cb-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 16px;
        gap: 16px;
    }

    .stspc-cb-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .stspc-cb-btn {
        text-align: center;
        width: 100%;
    }

    .stspc-cb-btn-manage {
        text-align: center;
    }

    .stspc-cb-prefs {
        padding: 0 16px 16px;
    }

    .stspc-cb-cat-desc {
        padding-left: 0;
    }

    .stspc-cb-cat-label {
        gap: 8px;
    }
}
