/* === Cookie Consent Banner & Preferences Modal === */

/* --- Bottom Banner --- */
.cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: var(--ivory, #FAF7F2);
    border-top: 1px solid var(--silver-mist, #D6D8D1);
    box-shadow: 0 -6px 28px rgba(13, 27, 62, 0.12);
    /* 6rem side padding keeps the copy and buttons clear of the sticky FABs,
       which sit at 28px from each edge and overlay the banner. */
    padding: 1.4rem 6rem;
    transform: translateY(110%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    visibility: hidden;
}

.cc-banner.is-visible {
    transform: translateY(0);
    visibility: visible;
}

.cc-banner-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.cc-banner-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.cc-banner-title {
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--deep-navy, #0D1B3E);
    margin: 0 0 0.35rem 0;
    line-height: 1.3;
}

.cc-banner-text {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--charcoal, #3A3A3A);
    margin: 0;
}

.cc-banner-text a {
    color: var(--sovereign-gold, #C9A84C);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-banner-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

/* --- Buttons --- */
.cc-btn {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.7rem 1.35rem;
    border-radius: 6px;
    border: 1.5px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.cc-btn:hover {
    transform: translateY(-1px);
}

.cc-btn-primary {
    background: var(--midnight-navy, #243660);
    color: var(--ivory, #FAF7F2);
}

.cc-btn-primary:hover {
    background: var(--deep-navy, #0D1B3E);
}

.cc-btn-secondary {
    background: transparent;
    color: var(--midnight-navy, #243660);
    border-color: var(--midnight-navy, #243660);
}

.cc-btn-secondary:hover {
    background: var(--midnight-navy, #243660);
    color: var(--ivory, #FAF7F2);
}

.cc-btn-link {
    background: transparent;
    color: var(--charcoal, #3A3A3A);
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0.7rem 0.6rem;
}

.cc-btn-link:hover {
    color: var(--sovereign-gold, #C9A84C);
}

/* --- Preferences Modal --- */
.cc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(13, 27, 62, 0.55);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cc-modal-overlay.is-open {
    display: flex;
}

.cc-modal {
    background: #fff;
    width: 100%;
    max-width: 620px;
    max-height: min(88vh, 780px);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ccSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ccSlideUp {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.cc-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.6rem 1.8rem 1.1rem;
    border-bottom: 1px solid #ececec;
}

.cc-modal-head h3 {
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--deep-navy, #0D1B3E);
    margin: 0 0 0.4rem 0;
}

.cc-modal-head p {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.85rem;
    line-height: 1.55;
    color: #5c5c5c;
    margin: 0;
}

.cc-modal-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cc-modal-close:hover {
    background: #e5e7eb;
    color: #111827;
}

.cc-modal-body {
    padding: 0.6rem 1.8rem 1.2rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

/* --- Category Rows --- */
.cc-category {
    padding: 1.15rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.cc-category:last-child {
    border-bottom: none;
}

.cc-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cc-category-name {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--deep-navy, #0D1B3E);
    margin: 0;
}

.cc-category-desc {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.825rem;
    line-height: 1.6;
    color: #5c5c5c;
    margin: 0.5rem 0 0 0;
}

.cc-always-on {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sovereign-gold, #C9A84C);
    white-space: nowrap;
}

/* --- Toggle Switch --- */
.cc-toggle {
    position: relative;
    flex: 0 0 auto;
    display: inline-block;
    width: 46px;
    height: 26px;
}

.cc-toggle input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.cc-toggle-track {
    position: absolute;
    inset: 0;
    background: #cfd3d8;
    border-radius: 999px;
    transition: background-color 0.25s ease;
    pointer-events: none;
}

.cc-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease;
}

.cc-toggle input:checked + .cc-toggle-track {
    background: var(--midnight-navy, #243660);
}

.cc-toggle input:checked + .cc-toggle-track::after {
    transform: translateX(20px);
}

.cc-toggle input:focus-visible + .cc-toggle-track {
    outline: 2px solid var(--sovereign-gold, #C9A84C);
    outline-offset: 2px;
}

.cc-toggle input:disabled {
    cursor: not-allowed;
}

.cc-toggle input:disabled + .cc-toggle-track {
    background: var(--sovereign-gold, #C9A84C);
    opacity: 0.55;
}

/* --- Modal Footer --- */
.cc-modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.8rem 1.5rem;
    border-top: 1px solid #ececec;
    background: #fcfcfb;
}

/* --- Footer trigger link --- */
.cc-settings-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}

/* --- Sticky FABs stay put and sit on top of the banner, in its side gutters.
       Above the banner (9998), below the preferences modal (10000).        --- */
body.cc-banner-open .wa-fab,
body.cc-banner-open .enquiry-fab {
    z-index: 9999;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .cc-banner {
        padding: 1.2rem 1.25rem 1.35rem;
        max-height: 80vh;
        overflow-y: auto;
    }

    .cc-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1.1rem;
    }

    .cc-banner-actions {
        flex-direction: column;
        align-items: stretch;
    }

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

    /* Buttons stack full-width here, so keep them clear of the FABs
       (which stay at bottom: 20px) instead of moving the FABs. */
    .cc-banner {
        padding-bottom: 5.5rem;
    }

    .cc-modal-head,
    .cc-modal-body,
    .cc-modal-foot {
        padding-left: 1.2rem;
        padding-right: 1.2rem;
    }

    .cc-modal-foot .cc-btn {
        width: 100%;
    }
}
