/* ============================================================
   Cookie Consent Banner - Styles
   ============================================================ */

/* Overlay */
.cc-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cc-overlay[hidden] {
    display: none;
}

/* Modal card */
.cc-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

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

/* Header */
.cc-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
}

.cc-header p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    margin: 0 0 1.5rem;
}

/* Accordion categories */
.cc-categories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.cc-category {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.cc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    cursor: pointer;
    user-select: none;
    background: #fafafa;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    transition: background-color 0.2s;
}

.cc-category-header:hover {
    background: #f0f0f0;
}

.cc-category-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.cc-category-header-left .cc-chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    transition: transform 0.25s ease;
}

.cc-category-header[aria-expanded="true"] .cc-chevron {
    transform: rotate(180deg);
}

.cc-category-header-right {
    flex-shrink: 0;
    margin-left: 0.75rem;
    align-items: center;
    display: flex;
    gap: 8px;
}

/* Toggle switch */
.cc-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.cc-toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.25s;
}

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

.cc-toggle input:checked + .cc-toggle-slider {
    background-color: var(--chain-primary-color, #1266f1);
}

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

.cc-toggle input:disabled + .cc-toggle-slider {
    opacity: 0.7;
    cursor: default;
}

/* "Always on" label */
.cc-always-on {
    font-size: 0.75rem;
    color: #888;
    font-weight: 400;
    white-space: nowrap;
}

/* Category detail (collapsible body) */
.cc-category-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.cc-category-detail[aria-hidden="false"] {
    max-height: 500px;
}

.cc-category-detail-inner {
    padding: 0 1rem 1rem;
}

.cc-category-description {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

/* Cookie table */
.cc-cookie-table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
}

.cc-cookie-table th,
.cc-cookie-table td {
    text-align: left;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #eee;
}

.cc-cookie-table th {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.cc-cookie-table td {
    color: #666;
}

/* Buttons */
.cc-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cc-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

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

.cc-btn-outline {
    background: transparent;
    border-color: #999;
    color: #555;
}

.cc-btn-primary {
    background: var(--chain-primary-color, #1266f1);
    color: #fff;
    border-color: var(--chain-primary-color, #1266f1);
}

/* Body scroll lock */
body.cc-no-scroll {
    overflow: hidden;
}

/* Responsive - small screens */
@media (max-width: 576px) {
    .cc-modal-body {
        padding: 1.25rem;
    }

    .cc-header h2 {
        font-size: 1.25rem;
    }

    .cc-buttons {
        flex-direction: column;
    }

    .cc-btn {
        min-width: unset;
    }

    .cc-cookie-table .cc-col-duration {
        display: none;
    }
}

.cc-floating-btn {
    position: fixed;
    bottom: 0px;
    left: 0px;
    z-index: 2;
    padding: 10px 10px 4px 4px;
    background: var(--chain-primary-color);
    border: none;
    border-radius: 0 50% 0 0;
    cursor: pointer;
}

.cc-floating-btn svg {
    height: 32px;
    width: 32px;
    color: white;
}