/* ==========================================================================
   Cookie Consent Banner & Settings Modal
   Theme: neppo
   Primary Color: #14B1BB (Hover: #0F7A81)
   Font: 'Montserrat', sans-serif
   ========================================================================== */

/* --- Cookie Banner (Скриншот 1) --- */
.cookie-banner-wrapper {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    width: calc(100% - 48px);
    max-width: 1200px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 24px 32px;
    z-index: 999999;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    opacity: 1;
    visibility: visible;
}

.cookie-banner-wrapper.cookie-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.cookie-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.cookie-banner-text {
    flex: 1 1 auto;
}

.cookie-banner-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
    margin: 0 0 10px 0;
}

.cookie-banner-desc {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.55;
    color: #4b5563;
    margin: 0;
}

.cookie-banner-desc a {
    color: #14b1bb;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.cookie-banner-desc a:hover {
    color: #0f7a81;
    text-decoration: underline;
}

/* --- Banner Actions --- */
.cookie-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 170px;
    flex-shrink: 0;
}

.cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    outline: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
}

.cookie-btn:focus-visible {
    outline: 2px solid #14b1bb;
    outline-offset: 2px;
}

.cookie-btn-primary {
    background-color: #14b1bb;
    color: #ffffff;
}

.cookie-btn-primary:hover {
    background-color: #0f7a81;
    color: #ffffff;
}

.cookie-btn-primary:active {
    background-color: #0c6369;
}

.cookie-btn-secondary {
    background-color: #f3f4f6;
    color: #1f2937;
}

.cookie-btn-secondary:hover {
    background-color: #e5e7eb;
    color: #111827;
}

.cookie-btn-secondary:active {
    background-color: #d1d5db;
}

.cookie-btn-outline {
    background-color: #ffffff;
    color: #1f2937;
    border: 1px solid #d1d5db;
}

.cookie-btn-outline:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

/* --- Modal Window (Скриншот 2) --- */
.cookie-modal {
    border: none;
    border-radius: 16px;
    padding: 0;
    max-width: 580px;
    width: calc(100% - 32px);
    background: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    color: #1f2937;
    box-sizing: border-box;
}

.cookie-modal::backdrop {
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px 18px;
    border-bottom: 1px solid #f3f4f6;
}

.cookie-modal-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.cookie-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #6b7280;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-modal-close:hover {
    color: #111827;
    background-color: #f3f4f6;
}

.cookie-modal-body {
    padding: 22px 28px;
    max-height: calc(85vh - 160px);
    overflow-y: auto;
}

.cookie-modal-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #4b5563;
    line-height: 1.5;
    margin: 0 0 20px 0;
}

/* Modal Cards */
.cookie-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 14px;
    background: #ffffff;
    transition: border-color 0.2s ease;
}

.cookie-card:last-child {
    margin-bottom: 0;
}

.cookie-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cookie-card-title-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.cookie-card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.cookie-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 9999px;
    background-color: rgba(20, 177, 187, 0.12);
    color: #0f7a81;
}

.cookie-card-desc {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: #6b7280;
    margin: 8px 0 0 0;
}

/* Custom Toggle Switch */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 26px;
}

.cookie-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.cookie-switch input:checked + .cookie-slider {
    background-color: #14b1bb;
}

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

.cookie-switch input:focus-visible + .cookie-slider {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #14b1bb;
}

.cookie-switch input:disabled + .cookie-slider {
    cursor: not-allowed;
    background-color: #8edde2;
    opacity: 0.9;
}

/* Modal Footer */
.cookie-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 28px 22px;
    border-top: 1px solid #f3f4f6;
    background-color: #ffffff;
}

/* --- Responsive Layout --- */
@media (max-width: 991px) {
    .cookie-banner-wrapper {
        bottom: 16px;
        width: calc(100% - 32px);
        padding: 20px 24px;
    }

    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .cookie-banner-actions {
        flex-direction: row;
        width: 100%;
    }

    .cookie-banner-actions .cookie-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 10px 12px;
        font-size: 12px;
    }
}

@media (max-width: 640px) {
    .cookie-banner-wrapper {
        bottom: 12px;
        width: calc(100% - 24px);
        padding: 18px 16px;
        border-radius: 14px;
    }

    .cookie-banner-title {
        font-size: 18px;
    }

    .cookie-banner-desc {
        font-size: 13px;
    }

    .cookie-banner-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .cookie-banner-actions .cookie-btn {
        width: 100%;
        padding: 11px 16px;
        font-size: 13px;
    }

    .cookie-modal {
        width: calc(100% - 20px);
        border-radius: 14px;
    }

    .cookie-modal-header {
        padding: 16px 20px;
    }

    .cookie-modal-body {
        padding: 16px 20px;
    }

    .cookie-modal-footer {
        padding: 16px 20px 20px;
        flex-direction: column;
        gap: 10px;
    }

    .cookie-modal-footer .cookie-btn {
        width: 100%;
    }
}
