﻿/* ── Widget slides up from bottom-right ── */
#cc-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    z-index: 99999;
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.35s;
}

#cc-widget.slide-down {
    transform: translateY(calc(100% + 32px));
    opacity: 0;
    pointer-events: none;
}

/* ── Reopen tab (appears after close) ── */
#cc-tab {
    position: fixed;
    bottom: 0;
    right: 32px;
    background: #1a3d1a;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 7px 16px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    z-index: 99998;
    border: none;
    display: block; /* always visible */
    letter-spacing: 0.01em;
}

    #cc-tab:hover {
        background: #163316;
    }

/* ── Header ── */
.cc-top {
    padding: 18px 20px 0;
}

.cc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

    .cc-header h3 {
        font-size: 15px;
        font-weight: 600;
        color: #111;
        margin: 0;
    }

.cc-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 19px;
    color: #888;
    line-height: 1;
    padding: 2px 4px;
}

    .cc-close:hover {
        color: #111;
    }

.cc-top p {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 14px;
}

.cc-top a {
    color: #1f5c1f;
    text-decoration: underline;
}

/* ── Preferences panel (whole section) ── */
.cc-prefs {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1);
}

    .cc-prefs.open {
        max-height: 600px;
    }

/* ── Category row ── */
.cc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
    cursor: pointer;
    user-select: none;
}

    .cc-row:hover {
        background: #fafafa;
    }

.cc-row-label {
    font-size: 13px;
    color: #111;
    font-weight: 500;
}

.cc-row-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cc-always {
    font-size: 12px;
    color: #1f5c1f;
    font-weight: 500;
}

/* ── Accordion description ── */
.cc-accordion {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: #f8f8f8;
    font-size: 12px;
    color: #666;
    line-height: 1.65;
    padding: 0 20px;
}

    .cc-accordion.open {
        max-height: 160px;
        padding: 10px 20px 12px;
        border-top: 1px solid #ececec;
    }

/* ── Toggle switch ── */
.toggle {
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: #ccc;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
    cursor: pointer;
}

    .toggle.on {
        background: #d4570a;
    }

.toggle-dot {
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.18s;
}

.toggle.on .toggle-dot {
    left: 20px;
}

/* ── Chevron arrow ── */
.chev {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #999;
    border-bottom: 2px solid #999;
    transform: rotate(45deg);
    transition: transform 0.25s;
    flex-shrink: 0;
    margin-bottom: 2px;
}

    .chev.up {
        transform: rotate(-135deg);
        margin-bottom: -2px;
    }

/* ── Action buttons ── */
.cc-btns {
    display: flex;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #f0f0f0;
}

.cc-btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #d0d0d0;
    background: transparent;
    color: #444;
    transition: background 0.15s;
}

    .cc-btn:hover {
        background: #f5f5f5;
    }

.cc-btn-accept {
    background: #1a3d1a;
    color: #fff;
    border: none;
}

    .cc-btn-accept:hover {
        background: #163316;
    }

.cc-btn-pref {
    color: #111;
    border-color: #bbb;
}

/* ════════════════════════════
       TABLET  481px – 768px
    ════════════════════════════ */
@media (min-width: 481px) and (max-width: 768px) {
    #cc-widget {
        width: 320px;
        bottom: 16px;
        right: 16px;
    }
}

/* ════════════════════════════
       MOBILE  ≤ 480px
       — full-width sheet from bottom
    ════════════════════════════ */
@media (max-width: 480px) {
    #cc-widget {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.14);
    }
        /* slide fully off the bottom edge on mobile */
        #cc-widget.slide-down {
            transform: translateY(calc(100% + 4px));
        }
    /* centre the reopen tab on mobile — always visible */
    #cc-tab {
        right: 50%;
        transform: translateX(50%);
        font-size: 13px;
        padding: 9px 22px;
        border-radius: 10px 10px 0 0;
        display: block;
    }
    /* roomier padding on small screens */
    .cc-top {
        padding: 20px 16px 0;
    }

    .cc-header h3 {
        font-size: 16px;
    }

    .cc-top p {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .cc-row {
        padding: 13px 16px;
    }

    .cc-row-label {
        font-size: 14px;
    }

    .cc-always {
        font-size: 13px;
    }

    .cc-accordion {
        padding: 0 16px;
        font-size: 13px;
    }

        .cc-accordion.open {
            padding: 10px 16px 13px;
        }
    /* larger touch targets for toggles */
    .toggle {
        width: 44px;
        height: 24px;
        border-radius: 12px;
    }

    .toggle-dot {
        width: 20px;
        height: 20px;
    }

    .toggle.on .toggle-dot {
        left: 22px;
    }
    /* buttons: Accept full-width on top, Deny + Save side by side below */
    .cc-btns {
        padding: 12px 16px 24px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .cc-btn {
        flex: 1 1 45%;
        padding: 13px 0;
        font-size: 14px;
    }

    .cc-btn-accept {
        flex: 1 1 100%;
        order: -1;
    }
}

