/* Контейнер */
.monobank-ui-container {
    position: relative;
    margin: 15px 0; /* Відстань над кнопками */
    width: 100%;
}

/* Кнопка на всю ширину */
.monobank-ui-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px; /* відстань між текстом і лапкою */
    width: 100% !important;
    padding: 10px 15px !important;
    background: #0f0f0f !important;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 25px !important;
    font-weight: bold !important;
    text-align: center !important;
    transition: all 0.3s ease;
    font-size: 15px !important;
    line-height: 1.4 !important;
}

.monobank-ui-btn::after {
    content: "";
    display: inline-block;
    width: 50px;
    height: 50px;
    background-image: url("https://gtm.org.ua/wp-content/uploads/mono_paw50.png");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

/* Ефект при наведенні */
.monobank-ui-btn:hover {
    background: #333333 !important;
}

/* Оверлей для фокусу (темний фон) */
.monobank-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6); /* Базове затемнення */
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    /* FIXED: Backdrop-filter для затемнення фону (не чіпає попап) */
    backdrop-filter: blur(2px) brightness(0.7); /* Блур + затемнення; fallback: просто rgba */
    -webkit-backdrop-filter: blur(2px) brightness(0.7); /* Для Safari */
}

.monobank-overlay.show {
    opacity: 1;
}

/* Модальний блок slide */
.monobank-ui-container.active .monobank-ui-slide {
    display: block;
}

.monobank-ui-slide {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9); /* ← ДОДАЙ: Початковий scale для анімації */
    width: 90%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease; /* Плавна анімація scale + opacity */
    max-height: 80vh;
    overflow-y: auto;
}
/* FIXED: Visible стан — повний scale + opacity */
.monobank-ui-container .monobank-ui-slide.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1); /* Повертаємо до центру */
}

/* Блокування скролу при відкритті */
body.monobank-modal-open {
    overflow: hidden;
    position: fixed; 
    width: 100%;
    touch-action: none;
    transition: none;
}

.monobank-ui-slide h3 {
    margin: 0 0 20px;
    font-size: 20px;
    color: #333;
    text-align: center;
    font-weight: 600;
}

/* FIXED: Слайдер контейнер */
.slider-container {
    position: relative;
    margin-bottom: 15px;
    text-align: center;
}

.parts-label {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.monobank-range {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.3s ease;
    margin-bottom: 50px;
}

.monobank-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 45px;
    height: 45px;
    background: url("https://gtm.org.ua/wp-content/uploads/mono_paw50.png") no-repeat center/contain, 
                linear-gradient(135deg, #737373, #3c3c3c);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent; /* Ховаємо номер, фокус на лапці */
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 2px solid #fff;
    transform: translateY(-18px); /* Твій зсув */
}

.monobank-range::-webkit-slider-thumb:hover {
    transform: translateY(-20px); /* Зберігаємо зсув */
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.monobank-range::-webkit-slider-thumb:active {
    background: url("https://gtm.org.ua/wp-content/uploads/mono_paw50.png") no-repeat center/contain, 
                linear-gradient(135deg, #737373, #3c3c3c);
}

/* Для треку: градієнт від сірого до зеленого */
.monobank-range::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #e0e0e0 0%, #3c3c3c 100%);
    height: 10px;
    border-radius: 5px;
}

.monobank-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 2px #3c3c3c;
}

/* Firefox support */
.monobank-range::-moz-range-thumb {
    width: 45px;
    height: 45px;
    /* FIXED: Іконка поверх градієнту */
    background: url("https://gtm.org.ua/wp-content/uploads/mono_paw50.png") no-repeat center/contain, 
                linear-gradient(135deg, #737373, #3c3c3c);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-weight: bold;
    font-size: 14px;
    transform: translateY(-18px);
}

/* FIXED: :active для Firefox */
.monobank-range::-moz-range-thumb:active {
    background: url("https://gtm.org.ua/wp-content/uploads/mono_paw50.png") no-repeat center/contain, 
                linear-gradient(135deg, #737373, #3c3c3c);
}

.monobank-range::-moz-range-track {
    background: linear-gradient(to right, #e0e0e0 0%, #3c3c3c 100%);
    height: 10px;
    border-radius: 5px;
}

.monthly {
    font-size: 18px;
    font-weight: bold;
    color: #3c3c3c;
    margin-bottom: 15px;
    text-align: center;
    padding: 10px;
    background: #f0f8ff;
    border-radius: 6px;
    transition: opacity 0.3s ease; /* Для fade в JS */
}
.monthly-amount {
    color: #28a745;
}

.mono-info-text {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.1;
}

.mono-buttons-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 10px; /* Відстань між кнопками */
    margin-top: 10px;
}

/* Кнопки в блоці */
.mono-proceed-btn,
.mono-cancel-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase !important;
    transition: all 0.3s ease;
    font-size: 15px;
    text-align: center;
}

.mono-proceed-btn {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%) !important;
    color: #fff !important;
    order: 2;
}

.mono-proceed-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%) !important;
}

.mono-cancel-btn {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    color: #fff !important;
    order: 1;
}

.mono-cancel-btn:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%) !important;
}

/* FIXED: Loader overlay для переходу на чекаут */
.loader-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1001; /* Вище попапу */
    text-align: center;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loader-overlay p {
    margin: 15px 0 0;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #28a745;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body.loading-state {
    cursor: wait; /* Опціонально: курсор "чекай" */
}

/* Мобільний адаптив */
@media (max-width: 768px) {
    .monobank-ui-slide {
        width: 95%;
        padding: 20px;
        transform: translateX(-50%);
    }

    .mono-proceed-btn,
    .mono-cancel-btn {
        flex: none;
        width: 100%;
        margin-bottom: 5px;
    }

    .monobank-range::-webkit-slider-thumb {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    .mono-buttons-wrapper {
        flex-direction: column-reverse; 
        gap: 10px;
    }
}

/* Інтеграція з Woodmart */
.monobank-ui-container .wd-button {
    font-family: inherit;
    line-height: inherit;
}