/* NSP Cookie Consent — banner (bottom) and modal */

:root {
    --nsp-cookie-primary: #fdb602;
    --nsp-cookie-primary-hover: #ffd61d;
    --nsp-cookie-primary-text: #471f01;
    --nsp-cookie-text: #1a1a1a;
    --nsp-cookie-text-muted: #555;
    --nsp-cookie-bg: #fff;
    --nsp-cookie-border: #101010;
    --nsp-cookie-shadow: rgba(0, 0, 0, 0.15);
}

/* Bottom banner — по умолчанию виден, скрывается только при согласии (JS ставит display:none) */
#nsp-cookie-banner.nsp-cookie-banner {
    display: block !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999998;
    background: var(--nsp-cookie-bg);
    box-shadow: 0 -2px 20px var(--nsp-cookie-shadow);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--nsp-cookie-text);
}

#nsp-cookie-banner.nsp-cookie-banner[aria-hidden="true"] {
    display: none !important;
}

.nsp-cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
}

.nsp-cookie-banner-content {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px 24px;
}

.nsp-cookie-banner-heading {
    margin: 0 0 8px;
    font-size: 1.1em;
    font-weight: 700;
    width: 100%;
}

.nsp-cookie-banner-text {
    margin: 0;
    flex: 1;
    min-width: 280px;
    max-width: 720px;
    color: var(--nsp-cookie-text-muted);
}

.nsp-cookie-show-details {
    color: var(--nsp-cookie-border);
    text-decoration: none;
    font-weight: 500;
}

.nsp-cookie-show-details:hover {
    text-decoration: underline;
}

.nsp-cookie-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.nsp-cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.nsp-cookie-btn-primary {
    background: var(--nsp-cookie-primary);
    color: var(--nsp-cookie-primary-text);
}

.nsp-cookie-btn-primary:hover {
    background: var(--nsp-cookie-primary-hover);
}

.nsp-cookie-btn-secondary,
.nsp-cookie-btn-outline {
    background: var(--nsp-cookie-bg);
    color: var(--nsp-cookie-border);
    border: 1px solid var(--nsp-cookie-border);
}

.nsp-cookie-btn-secondary:hover,
.nsp-cookie-btn-outline:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Жёлтый и чёрный — принудительно для баннера и модалки (перебиваем тему) */
#nsp-cookie-banner .nsp-cookie-btn-primary,
#nsp-cookie-modal .nsp-cookie-btn-primary {
    background: #fdb602 !important;
    color: #471f01 !important;
    border: 1px solid #fdb602 !important;
}

#nsp-cookie-banner .nsp-cookie-btn-primary:hover,
#nsp-cookie-modal .nsp-cookie-btn-primary:hover {
    background: #ffd61d !important;
    border-color: #ffd61d !important;
}

#nsp-cookie-banner .nsp-cookie-btn-secondary,
#nsp-cookie-modal .nsp-cookie-btn-outline {
    background: #fff !important;
    color: #101010 !important;
    border: 1px solid #101010 !important;
}

#nsp-cookie-banner .nsp-cookie-btn-secondary:hover,
#nsp-cookie-modal .nsp-cookie-btn-outline:hover {
    background: rgba(0, 0, 0, 0.06) !important;
}

/* Modal overlay */
.nsp-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: visibility 0.2s, opacity 0.2s;
}

.nsp-cookie-modal.is-open {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.nsp-cookie-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.nsp-cookie-modal-box {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    background: var(--nsp-cookie-bg);
    border-radius: 8px;
    box-shadow: 0 20px 60px var(--nsp-cookie-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nsp-cookie-modal-header {
    padding: 20px 24px 0;
    border-bottom: 1px solid #eee;
}

.nsp-cookie-tabs {
    display: flex;
    gap: 0;
}

.nsp-cookie-tab {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--nsp-cookie-text-muted);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}

.nsp-cookie-tab:hover {
    color: var(--nsp-cookie-text);
}

.nsp-cookie-tab.active {
    color: var(--nsp-cookie-border);
    border-bottom-color: var(--nsp-cookie-border);
}

.nsp-cookie-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.nsp-cookie-panel {
    display: none;
}

.nsp-cookie-panel.active {
    display: block;
}

.nsp-cookie-panel-heading {
    margin: 0 0 12px;
    font-size: 1.25em;
    font-weight: 700;
}

.nsp-cookie-panel-text {
    margin: 0;
    color: var(--nsp-cookie-text-muted);
}

/* Details tab — categories */
.nsp-cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.nsp-cookie-category {
    border-bottom: 1px solid #eee;
}

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

.nsp-cookie-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--nsp-cookie-text);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}

.nsp-cookie-category-header:hover {
    color: var(--nsp-cookie-border);
}

.nsp-cookie-category-title {
    flex: 1;
}

.nsp-cookie-category-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--nsp-cookie-text-muted);
    background: #eee;
    padding: 2px 8px;
    border-radius: 12px;
}

.nsp-cookie-category-chevron {
    transform: rotate(0deg);
    transition: transform 0.2s;
}

.nsp-cookie-category.expanded .nsp-cookie-category-chevron {
    transform: rotate(90deg);
}

.nsp-cookie-category-body {
    display: none;
    padding: 0 0 16px;
}

.nsp-cookie-category.expanded .nsp-cookie-category-body {
    display: block;
}

.nsp-cookie-category-desc {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--nsp-cookie-text-muted);
    line-height: 1.5;
}

.nsp-cookie-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.nsp-cookie-toggle-label {
    font-size: 13px;
    color: var(--nsp-cookie-text);
}

.nsp-cookie-toggle {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.nsp-cookie-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    transition: background 0.2s;
}

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

.nsp-cookie-toggle:checked + .nsp-cookie-toggle-slider,
.nsp-cookie-toggle:disabled + .nsp-cookie-toggle-slider {
    background: var(--nsp-cookie-primary);
}

.nsp-cookie-toggle:checked + .nsp-cookie-toggle-slider::after,
.nsp-cookie-toggle:disabled + .nsp-cookie-toggle-slider::after {
    transform: translateX(20px);
}

.nsp-cookie-toggle:disabled + .nsp-cookie-toggle-slider {
    opacity: 0.8;
    cursor: not-allowed;
}

/* About tab */
.nsp-cookie-about p {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--nsp-cookie-text);
    line-height: 1.6;
}

.nsp-cookie-about p:last-child {
    margin-bottom: 0;
}

.nsp-cookie-link {
    color: var(--nsp-cookie-border);
    text-decoration: none;
}

.nsp-cookie-link:hover {
    text-decoration: underline;
}

/* Modal footer */
.nsp-cookie-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px 24px;
    border-top: 1px solid #eee;
}

.nsp-cookie-btn-accept-selected {
    margin-right: auto;
    background: #eee !important;
    color: #1a1a1a !important;
}

.nsp-cookie-btn-accept-selected:hover {
    background: #e0e0e0 !important;
}
