/* Модальное окно покупки */
.buy-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.buy-dialog.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.buy-dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.buy-dialog-content {
    position: relative;
    background-color: #ffffff;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: 1;
    animation: buyDialogFadeIn 0.3s ease-out;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

@keyframes buyDialogFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.buy-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.buy-dialog-title {
    font-size: 20px;
    font-weight: 600;
    color: #333333;
    margin: 0;
    font-family: 'Onest', sans-serif;
}

.buy-dialog-close {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #999999;
    transition: color 0.2s ease, transform 0.2s ease;
    line-height: 1;
}

.buy-dialog-close:hover {
    color: #333333;
    transform: scale(1.1);
}

.buy-dialog-close span {
    display: block;
    line-height: 1;
}

.buy-dialog-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

.buy-product-info {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.buy-product-name {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin: 0 0 10px 0;
    font-family: 'Onest', sans-serif;
}

.buy-product-price {
    font-size: 24px;
    font-weight: 600;
    color: #000000;
    font-family: 'Onest', sans-serif;
}

.buy-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.buy-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.buy-form-label {
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    font-family: 'Onest', sans-serif;
}

.buy-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Onest', sans-serif;
    color: #333333;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.buy-form-input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.buy-form-input::placeholder {
    color: #999999;
}

.buy-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.buy-button {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Onest', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.buy-button.cancel {
    background-color: #f5f5f5;
    color: #333333;
}

.buy-button.cancel:hover {
    background-color: #e0e0e0;
    transform: translateY(-1px);
}

.buy-button.submit {
    background-color: #000000;
    color: #ffffff;
}

.buy-button.submit:hover {
    background-color: #333333;
    transform: translateY(-1px);
}

.buy-button.submit:disabled {
    background-color: #999999;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 480px) {
    .buy-dialog-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .buy-dialog-header {
        padding: 16px;
    }
    
    .buy-dialog-title {
        font-size: 18px;
    }
    
    .buy-dialog-body {
        padding: 16px;
    }
    
    .buy-product-name {
        font-size: 16px;
    }
    
    .buy-product-price {
        font-size: 20px;
    }
    
    .buy-form-actions {
        flex-direction: column;
    }
    
    .buy-button {
        width: 100%;
    }
}
