/* ============================================================
   NigmaPress Cookie Consent — Frontend (баннер + модалка отзыва)
   ============================================================ */

/* --- Переменные по умолчанию --- */
:root {
    --npcb-primary-color: #3c40c6;
    --npcb-primary-hover: #2b2eb0;
    --npcb-link-color: #ff5e57;
    --npcb-bg-color: #ffffff;
    --npcb-text-color: #1d2327;
    --npcb-border-color: #cdcdcd;
    --npcb-border-radius: 10px;
    --npcb-btn-radius: 6px;
    --npcb-modal-bg: #ffffff;
    --npcb-modal-text: #1d2327;
    --npcb-modal-text-muted: #50575e;
    --npcb-btn-cancel-bg: #f0f0f1;
    --npcb-btn-cancel-hover: #e0e0e1;
    --npcb-btn-cancel-text: #3c434a;
    --npcb-btn-danger-bg: #dc3232;
    --npcb-btn-danger-hover: #871717;
    --npcb-btn-danger-text: #ffffff;
}

/* Каркас */
.npress-cookie {
    position: fixed;
    bottom: 0;
    left: 50%;
    max-width: 100%;
    width: 600px;
    margin-left: -300px;
    z-index: 9999;
}
.npress-cookie.npress-cookie_options_visible {
    height: 339px;
}
.npress-cookie:before {
    position: fixed;
    background: linear-gradient(0deg, hsl(0deg 0% 0% / 50%), transparent);
    width: 100%;
    left: 0;
    bottom: 0;
    height: 220px;
    content: '';
    z-index: -1;
}
.npress-cookie__popup {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    display: none;
}
.npress-cookie.npress-cookie_options_visible .npress-cookie__popup {
    display: block;
}

/* Оформление */
.npress-cookie__data {
    padding: 20px 30px;
    border-radius: var(--npcb-border-radius) var(--npcb-border-radius) 0 0;
    box-shadow: 0 0 30px hsl(0deg 0% 0% / 42%);
    line-height: 34px;
    background: var(--npcb-bg-color);
    color: var(--npcb-text-color);
}
.npress-cookie__text a {
    color: var(--npcb-link-color);
    border-bottom: 1px solid var(--npcb-link-color);
    transition: .5s;
}
.npress-cookie__buttons {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.npress-cookie__options {
    color: var(--npcb-primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.npress-cookie__options:hover {
    color: var(--npcb-link-color);
}
.npress-cookie__options:after {
    content: '→';
    font-size: 15px;
}
.npress-cookie__text strong {
    font-size: 18px;
    display: block;
    font-weight: 400;
}
.npress-cookie__popup {
    background: var(--npcb-bg-color);
    color: var(--npcb-text-color);
    padding: 20px 30px;
    border-radius: var(--npcb-border-radius) var(--npcb-border-radius) 0 0;
    line-height: 34px;
}
.npress-cookie__popup-title {
    font-size: 20px;
    padding-left: 25px;
    cursor: pointer;
    position: relative;
    display: inline-block;
}
.npress-cookie__popup-title:before {
    content: '←';
    position: absolute;
    top: 0;
    left: 0;
    font-size: 15px;
}
.npress-cookie__popup-text {
    line-height: 1.5;
    margin: 18px 0;
}
.npress-cookie__popup-param {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px solid var(--npcb-border-color);
}
.npress-cookie__popup-grant {
    color: var(--npcb-primary-color);
    font-size: 14px;
}
.npress-cookie__popup-param.b {
    border-bottom: 1px solid var(--npcb-border-color);
}
.npress-cookie__popup-check {
    font-size: 14px;
}
.npress-cookie__popup-check label {
    cursor: pointer;
}
.npress-cookie__popup-check label input {
    margin-bottom: 1px;
    vertical-align: middle;
}
.npress-cookie__buttons form {
    margin-bottom: 0;
}

/* Кнопки внутри баннера */
.npress-cookie .btn,
.npress-cookie .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--npcb-btn-radius);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.npress-cookie .btn-primary {
    background-color: var(--npcb-primary-color) !important;
    color: #ffffff !important;
    border-color: var(--npcb-primary-color) !important;
}
.npress-cookie .btn-primary:hover {
    background-color: var(--npcb-primary-hover) !important;
    border-color: var(--npcb-primary-hover) !important;
}

/* Сброс кнопки отзыва */
.npcb-revoke-btn,
.npcb-revoke-btn:hover,
.npcb-revoke-btn:focus,
.npcb-revoke-btn:active {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: inherit !important;
    cursor: pointer !important;
    display: inline !important;
    font: inherit !important;
    letter-spacing: inherit !important;
    line-height: inherit !important;
    margin: 0 !important;
    outline: none !important;
    padding: 0 !important;
    text-align: inherit !important;
    text-decoration: inherit !important;
    text-transform: inherit !important;
    vertical-align: baseline !important;
    width: auto !important;
}
.npcb-revoke-btn::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/* Мобильная адаптация баннера */
@media (max-width: 767px) {
    .npress-cookie {
        left: 0;
        margin-left: 0;
        width: 100%;
    }
    .npress-cookie.npress-cookie_options_visible {
        height: 360px;
    }
    .npress-cookie__popup-param,
    .npress-cookie__popup-grant {
        line-height: 24px;
        font-size: 13px;
    }
    .npress-cookie__text,
    .npress-cookie__text strong {
        font-size: 15px;
        line-height: 24px;
    }
    .npress-cookie__buttons,
    .npress-cookie__popup-text {
        font-size: 14px;
    }
    .npress-cookie__data,
    .npress-cookie__popup {
        padding: 12px 16px;
    }
}

/* --- Модальное окно отзыва согласия --- */
.npcb-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.npcb-modal.is-active {
    display: flex;
}
.npcb-modal__overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}
.npcb-modal__window {
    position: relative;
    background: var(--npcb-modal-bg);
    color: var(--npcb-modal-text);
    width: 100%;
    max-width: 420px;
    padding: 30px;
    border-radius: var(--npcb-border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1;
    animation: npcbFadeIn 0.2s ease-out;
}
@keyframes npcbFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.npcb-modal__title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--npcb-modal-text);
}
.npcb-modal__text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--npcb-modal-text-muted);
    margin-bottom: 24px;
}
.npcb-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.npcb-modal__actions button {
    padding: 10px 20px;
    border-radius: var(--npcb-btn-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.2s;
    font-family: inherit;
}
.npcb-modal__cancel {
    background: var(--npcb-btn-cancel-bg);
    color: var(--npcb-btn-cancel-text);
}
.npcb-modal__cancel:hover {
    background: var(--npcb-btn-cancel-hover);
}
.npcb-modal__confirm {
    background: var(--npcb-btn-danger-bg);
    color: var(--npcb-btn-danger-text);
}
.npcb-modal__confirm:hover {
    background: var(--npcb-btn-danger-hover);
}
.npcb-modal__confirm:disabled {
    opacity: 0.6;
    cursor: wait;
}

@media (max-width: 600px) {
    .npcb-modal__window { margin: 20px; padding: 20px; }
    .npcb-modal__actions { flex-direction: column; }
    .npcb-modal__actions button { width: 100%; }
}