/* ============================================================
   Cookie Consent Banner & Preferences Modal
   GDPR-compliant, non-intrusive, equal-weight buttons
   ============================================================ */

/* --- Bottom Bar Banner --- */
.cc-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9998;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding: 1.5rem 0;
    font-family: inherit;
}

.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: #4b5563;
}

.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: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.cc-btn:hover {
    opacity: 0.85;
}

/* Accept & Reject share identical visual weight */
.cc-btn-accept,
.cc-btn-reject {
    background-color: #dc2626;
    color: #ffffff;
    min-width: 140px;
}

/* Secondary style for Manage Preferences */
.cc-btn-manage {
    background-color: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
    min-width: 140px;
}

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

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

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

.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: #111827;
    margin: 0;
}

.cc-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

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

.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 #f3f4f6;
    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: #111827;
    margin-bottom: 0.25rem;
}

.cc-category-desc {
    font-size: 0.85rem;
    color: #6b7280;
    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: #d1d5db;
    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: #dc2626;
}

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

/* Disabled (Strictly Necessary) */
.cc-toggle input:disabled + .cc-toggle-slider {
    background-color: #fca5a5;
    cursor: not-allowed;
    opacity: 0.7;
}

.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-color: #dc2626;
    color: #ffffff;
    min-width: 180px;
}

/* --- 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: #dc2626;
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 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(220, 38, 38, 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;
    }
}
