#cookieConsentModal .modal-content,
#cookiePreferencesModal .modal-content {
    border: none;
    border-radius: 26px !important;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
    background-color: #ffffff;
}

/* Fixed header/footer, scrollable body */
#cookieConsentModal .modal-dialog {
    max-height: calc(100% - 1rem);
    display: flex;
}
#cookieConsentModal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 3.5rem);
}
#cookieConsentModal .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
}

/* ---------- Header ---------- */
#cookieConsentModal .modal-header {
    flex: 0 0 auto;
    border-bottom: 1px solid #eef0f2;
    padding: 26px 28px 22px;
    align-items: flex-start;
    gap: 16px;
}
#cookieConsentModal .cookie-header-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
#cookieConsentModal .cookie-icon-circle {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f1f2f4;
    display: flex;
    align-items: center;
    justify-content: center;
}
#cookieConsentModal .cookie-icon-circle svg { width: 30px; height: 30px; }
#cookieConsentModal .modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1c1c1e;
    margin-bottom: 6px;
}
#cookieConsentModal .cookie-header-desc {
    font-size: .875rem;
    line-height: 1.55;
    color: #6b7280;
    margin: 0;
    max-width: 520px;
}
#cookieConsentModal .cookie-close-btn {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #e6e8eb;
    background: #fff;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .15s ease, color .15s ease;
    cursor: pointer;
}
#cookieConsentModal .cookie-close-btn:hover { background: #f3f4f6; color: #111827; }
.disabled_cookie{
    cursor: not-allowed !important;
}

/* ---------- Body ---------- */
#cookieConsentModal .modal-body { padding: 22px 28px; }

.cookie-accordion .accordion-item {
    border: 1px solid #eceef0;
    border-radius: 14px !important;
    margin-bottom: 14px;
    background-color: #fafbfc;
    overflow: hidden;
}
.cookie-accordion .accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    margin: 0;
}
.cookie-accordion .accordion-toggle-btn {
    background: none;
    border: none;
    font-weight: 600;
    color: #1c1c1e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    text-align: left;
    width: 100%;
    cursor: pointer;
}
.cookie-accordion .cookie-card-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
}
.accordion-header:focus-visible{
    outline: none !important;
}
.cookie-accordion .accordion-header:focus,
.cookie-accordion .accordion-header:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}
 button:focus {
    outline: none !important;
    box-shadow: none !important;
}
.cookie-accordion .cookie-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #eef0f2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #374151;
}
.cookie-accordion .cookie-card-icon svg { width: 19px; height: 19px; }

/* Plus/Minus toggle indicator, right aligned */
.cookie-accordion .accordion-toggle-btn::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    color: #6b7280;
    display: inline-block;
    width: 20px;
    text-align: center;
}
.cookie-accordion .accordion-toggle-btn[aria-expanded="true"]::after {
    content: '\2212'; /* Unicode minus sign */
}

/* Prevents the open section from collapsing when clicking its own minus button */
.cookie-accordion .accordion-toggle-btn[aria-expanded="true"] {
    pointer-events: none;
    cursor: default;
}

.cookie-switch-wrapper { position: relative; z-index: 2; }
.cookie-accordion .accordion-body { padding: 0 14px 14px; }

.cookie-sub-list {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cookie-sub-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background-color: #ffffff;
    border: 1px solid #eef0f2;
    border-radius: 12px;
    padding: 16px 18px;
}
.cookie-sub-item .cookie-sub-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f1f2f4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
}
.cookie-sub-item .cookie-sub-icon svg { width: 22px; height: 22px; }
.cookie-sub-item .cookie-sub-content { flex: 1 1 auto; min-width: 0; }
.cookie-sub-item .cookie-sub-content strong {
    display: block;
    font-size: .975rem;
    color: #1c1c1e;
    margin-bottom: 4px;
}
.cookie-sub-item .cookie-sub-content p {
    font-size: .82rem;
    line-height: 1.55;
    color: #6b7280;
    margin: 0;
}
.cookie-always-active {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #eceef1;
    color: #374151;
    font-size: .78rem;
    font-weight: 500;
    padding: 6px 10px 6px 12px;
    border-radius: 999px;
    white-space: nowrap;
}
.cookie-always-active .cookie-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1c1c1e;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cookie-always-active .cookie-check svg { width: 11px; height: 11px; }

/* Toggle switches */
.cookie-accordion .form-check.form-switch {
    padding-left: 0;
    margin: 0;
    min-height: auto;
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
    padding-top: 2px;
}
.cookie-accordion .form-check.form-switch .form-check-input {
    float: none;
    margin: 0;
    width: 38px;
    height: 20px;
    border: none;
    border-radius: 20px;
    background-color: #d1d5db;
    background-image: none;
    cursor: pointer;
    transition: background-color .2s ease;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
}
.cookie-accordion .form-check.form-switch .form-check-input::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.cookie-accordion .form-check.form-switch .form-check-input:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}
.cookie-accordion .form-check.form-switch .form-check-input:checked::before {
    transform: translateX(18px);
}
.cookie-accordion .form-check.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .25);
    outline: none;
}
.cookie-accordion .form-check.form-switch .form-check-input:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* ---------- Info box ---------- */
#cookieConsentModal .cookie-info-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f7f8fa;
    border: 1px solid #eef0f2;
    border-radius: 12px;
    padding: 14px 18px;
    margin-top: 4px;
    font-size: .85rem;
    color: #4b5563;
}
#cookieConsentModal .cookie-info-box svg { flex: 0 0 auto; width: 18px; height: 18px; color: #6b7280; }
#cookieConsentModal .cookie-info-box a { color: #2563eb; text-decoration: none; font-weight: 500; }
#cookieConsentModal .cookie-info-box a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
#cookieConsentModal .modal-footer {
    flex: 0 0 auto;
    border-top: 1px solid #eef0f2;
    padding: 18px 28px;
    gap: 12px;
}
#cookieConsentModal .cookie-btn {
    border-radius: 14px;
    font-size: .9rem;
    font-weight: 600;
    padding: 10px 22px;
    border: 1px solid transparent;
    transition: all .15s ease;
}
#cookieConsentModal .cookie-btn-outline {
    background: #fff;
    border-color: #d7dade;
    color: #1c1c1e;
}
#cookieConsentModal .cookie-btn-outline:hover { background: #f3f4f6; }
#cookieConsentModal .cookie-btn-dark {
    background: #1c1c1e;
    color: #fff;
}
#cookieConsentModal .cookie-btn-dark:hover { background: #000; }

@media (max-width: 575.98px) {
    #cookieConsentModal .modal-dialog { margin: .5rem auto; }
    #cookieConsentModal .modal-content { border-radius: 18px !important; max-height: calc(100vh - 1rem); }

    /* Header */
    #cookieConsentModal .modal-header { flex-direction: row; padding: 14px 14px 12px; gap: 10px; }
    #cookieConsentModal .cookie-header-left { gap: 10px; }
    #cookieConsentModal .cookie-icon-circle { width: 38px; height: 38px; }
    #cookieConsentModal .cookie-icon-circle svg { width: 20px; height: 20px; }
    #cookieConsentModal .modal-title { font-size: 1rem; margin-bottom: 2px; }
    #cookieConsentModal .cookie-header-desc { font-size: .72rem; line-height: 1.4; }

    /* Body */
    #cookieConsentModal .modal-body { padding: 12px 14px; }
    .cookie-accordion .accordion-item { margin-bottom: 9px; border-radius: 11px !important; }
    .cookie-accordion .accordion-toggle-btn { padding: 11px 12px; }
    .cookie-accordion .cookie-card-label { font-size: .875rem; gap: 9px; }
    .cookie-accordion .cookie-card-icon { width: 26px; height: 26px; border-radius: 7px; }
    .cookie-accordion .cookie-card-icon svg { width: 15px; height: 15px; }
    .cookie-accordion .accordion-toggle-btn::after { font-size: 1.2rem; width: 15px; }
    .cookie-accordion .accordion-body { padding: 0 9px 9px; }

    .cookie-sub-item { flex-wrap: nowrap; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: 9px; }
    .cookie-sub-item .cookie-sub-icon { width: 32px; height: 32px; }
    .cookie-sub-item .cookie-sub-icon svg { width: 16px; height: 16px; }
    .cookie-sub-item .cookie-sub-content strong { font-size: .82rem; margin-bottom: 2px; }
    .cookie-sub-item .cookie-sub-content p { font-size: .72rem; line-height: 1.4; }

    .cookie-sub-list { gap: 10px; }
    .cookie-accordion .form-check.form-switch .form-check-input { width: 34px; height: 18px; }
    .cookie-accordion .form-check.form-switch .form-check-input::before { width: 14px; height: 14px; }
    .cookie-accordion .form-check.form-switch .form-check-input:checked::before { transform: translateX(16px); }

    /* Info box */
    #cookieConsentModal .cookie-info-box { padding: 10px 12px; font-size: .72rem; gap: 9px; }
    #cookieConsentModal .cookie-info-box svg { width: 15px; height: 15px; }

    /* Footer */
    #cookieConsentModal .modal-footer { padding: 11px 14px; gap: 9px; }
    #cookieConsentModal .cookie-btn { padding: 8px 16px; font-size: .8rem; border-radius: 11px; }
}