/* Модальное окно "Купить в один клик" */
.one-click-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.one-click-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.one-click-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    margin: 50px auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    max-height: 90vh;
    overflow-y: auto;
}

.one-click-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.one-click-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}

.one-click-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 28px;
    text-align: center;
}

.one-click-modal-close:hover {
    color: #333;
}

.one-click-modal-body {
    padding: 20px;
}

.one-click-modal-body .form-group {
    margin-bottom: 15px;
}

.one-click-modal-body label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.one-click-modal-body .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.one-click-modal-body .form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}
.one-click-modal-body .btn {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.one-click-modal-body .btn-primary {
    background-color: #007bff;
    color: #fff;
}

.one-click-modal-body .btn-primary:hover {
    background-color: #0056b3;
}

.one-click-modal-body .btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.one-click-modal-body .btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.one-click-modal-body .btn-secondary:hover {
    background-color: #545b62;
}

.one-click-modal-body .alert {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.one-click-modal-body .alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.one-click-modal-body .alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Стили для кнопки "Купить в один клик" в каталоге и на странице товара */
.btn-ar.btn-success a[onclick*="openOneClickModal"] {
    color: #fff !important;
    text-decoration: none;
}

.btn-ar.btn-success:hover a[onclick*="openOneClickModal"] {
    color: #fff !important;
    text-decoration: none;
}

.btn-ar.btn-success:active a[onclick*="openOneClickModal"] {
    color: #fff !important;
    text-decoration: none;
}

.buy-on-click-button{
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #02c66c 5%, #02ad5e 100%);
    margin: 0;
    padding: 0;
    border: none;
    text-align: center;
    height: 32px;
    line-height: 32px;
    color: #fff;
    text-decoration: none;
}

.buy-on-click-button:hover{
    color: white!important;

}

/* Убираем hover эффект для кнопки "Купить в один клик" */
.one-click-button:hover,
.btn-ar.btn-success:has(a[onclick*="openOneClickModal"]):hover {
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #02c66c), color-stop(1, #02ad5e)) !important;
    background: -moz-linear-gradient(top, #02c66c 5%, #02ad5e 100%) !important;
    background: -webkit-linear-gradient(top, #02c66c 5%, #02ad5e 100%) !important;
    background: -o-linear-gradient(top, #02c66c 5%, #02ad5e 100%) !important;
    background: -ms-linear-gradient(top, #02c66c 5%, #02ad5e 100%) !important;
    background: linear-gradient(to bottom, #02c66c 5%, #02ad5e 100%) !important;
    background-color: #02c66c !important;
    border: 1px solid #02ad5e !important;
}

/* Альтернативный вариант для браузеров без поддержки :has() */
div.btn-ar.btn-success[style*="margin-top: 10px"]:hover,
div.btn-ar.btn-success[style*="margin-top: 5px"]:hover {
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #02c66c), color-stop(1, #02ad5e)) !important;
    background: -moz-linear-gradient(top, #02c66c 5%, #02ad5e 100%) !important;
    background: -webkit-linear-gradient(top, #02c66c 5%, #02ad5e 100%) !important;
    background: -o-linear-gradient(top, #02c66c 5%, #02ad5e 100%) !important;
    background: -ms-linear-gradient(top, #02c66c 5%, #02ad5e 100%) !important;
    background: linear-gradient(to bottom, #02c66c 5%, #02ad5e 100%) !important;
    background-color: #02c66c !important;
    border: 1px solid #02ad5e !important;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .one-click-modal-content {
        width: 95%;
        margin: 20px auto;
        max-height: 95vh;
    }

    .one-click-modal-header {
        padding: 15px;
    }

    .one-click-modal-body {
        padding: 15px;
    }
}