/* ============================================================
   Cookie Consent Banner & Preferences Modal
   GDPR-compliant, non-intrusive, equal-weight buttons
   Styled to match the landing page brand
   ============================================================ */

/* --- Bottom Bar Banner --- */
.cc-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9998;
    background: var(--bg, #FAFAF7);
    border-top: 1px solid var(--gray-200, #D9D9D4);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding: 1.5rem 0;
    font-family: 'DM Sans', sans-serif;
}

.cc-banner.cc-visible {
    display: block;
}

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

.cc-banner-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary, #555566);
}

.cc-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Equal-weight primary buttons (Accept / Reject) */
.cc-btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
    white-space: nowrap;
    font-family: 'DM Sans', sans-serif;
}

.cc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Accept & Reject share identical visual weight */
.cc-btn-accept,
.cc-btn-reject {
    background: linear-gradient(135deg, var(--brand, #1B6B4A), var(--brand-dark, #134E35));
    color: #ffffff;
    min-width: 140px;
}

.cc-btn-accept:hover,
.cc-btn-reject:hover {
    background: linear-gradient(135deg, var(--brand-dark, #134E35), var(--brand, #1B6B4A));
}

/* Secondary style for Manage Preferences */
.cc-btn-manage {
    background-color: transparent;
    color: var(--brand, #1B6B4A);
    border: 2px solid var(--brand, #1B6B4A);
    min-width: 140px;
}

.cc-btn-manage:hover {
    background: var(--brand-light, #E8F5EE);
}

/* --- Preferences Modal Overlay --- */
.cc-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(26, 26, 46, 0.5);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.cc-modal-overlay.cc-visible {
    display: flex;
}

.cc-modal {
    background: #ffffff;
    border-radius: 1.25rem;
    max-width: 540px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--gray-100, #EDEDEA);
}

.cc-modal-header {
    padding: 1.5rem 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cc-modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text, #1A1A2E);
    margin: 0;
    font-family: 'Playfair Display', serif;
}

.cc-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-300, #B0B0A8);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.cc-modal-close:hover {
    color: var(--text, #1A1A2E);
}

.cc-modal-body {
    padding: 1.5rem;
}

/* --- Category Rows --- */
.cc-category {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-100, #EDEDEA);
    gap: 1rem;
}

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

.cc-category-info {
    flex: 1;
}

.cc-category-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text, #1A1A2E);
    margin-bottom: 0.25rem;
}

.cc-category-desc {
    font-size: 0.85rem;
    color: var(--text-secondary, #555566);
    line-height: 1.5;
}

/* --- Toggle Switch --- */
.cc-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.cc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cc-toggle-slider {
    position: absolute;
    inset: 0;
    background-color: var(--gray-200, #D9D9D4);
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.cc-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.25s ease;
}

.cc-toggle input:checked + .cc-toggle-slider {
    background-color: var(--brand, #1B6B4A);
}

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

/* Disabled (Strictly Necessary) */
.cc-toggle input:disabled + .cc-toggle-slider {
    background-color: var(--brand, #1B6B4A);
    cursor: not-allowed;
    opacity: 0.5;
}

.cc-toggle input:disabled:checked + .cc-toggle-slider::before {
    transform: translateX(20px);
}

/* --- Modal Footer --- */
.cc-modal-footer {
    padding: 0 1.5rem 1.5rem;
    text-align: right;
}

.cc-btn-save {
    background: linear-gradient(135deg, var(--brand, #1B6B4A), var(--brand-dark, #134E35));
    color: #ffffff;
    min-width: 180px;
}

.cc-btn-save:hover {
    background: linear-gradient(135deg, var(--brand-dark, #134E35), var(--brand, #1B6B4A));
}

/* --- Floating Revoker Icon --- */
.cc-revoker {
    display: none;
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 9997;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand, #1B6B4A), var(--brand-dark, #134E35));
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(27, 107, 74, 0.35);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cc-revoker:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(27, 107, 74, 0.45);
}

.cc-revoker.cc-visible {
    display: flex;
}

.cc-revoker svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .cc-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

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

    .cc-btn {
        width: 100%;
    }

    .cc-modal {
        max-height: 90vh;
    }
}
