/* Кнопка заказа */
.pcm-order-button {
    z-index: 9998;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-family: inherit;
}

.pcm-order-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.pcm-order-button:active {
    transform: translateY(0);
}

.pcm-position-fixed {
    position: fixed;
    bottom: 30px;
    right: 30px;
}

.pcm-position-floating {
    position: fixed;
    bottom: 30px;
    left: 30px;
}

/* Шорткод кнопка */
.pcm-shortcode-button {
    padding: 12px 24px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pcm-shortcode-button:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
}

/* Модальное окно */
.pcm-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pcm-modal-content {
    background-color: var(--pcm-bg-color, #fff);
    margin: 20px auto;
    padding: 0;
    border-radius: var(--pcm-border-radius, 16px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    position: relative;
    max-width: 95%;
}

/* Динамические размеры окна */
.pcm-modal-content.pcm-width-percent {
    width: var(--pcm-width-percent, 90%);
}

.pcm-modal-content.pcm-width-px {
    width: var(--pcm-width-px, 500px);
}

.pcm-modal-content.pcm-width-auto {
    width: auto;
    max-width: 95%;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pcm-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--pcm-header-bg-start, #d55028) 0%, var(--pcm-header-bg-end, #ad2b03) 100%);
    border-radius: var(--pcm-border-radius, 16px) var(--pcm-border-radius, 16px) 0 0;
}

.pcm-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--pcm-header-text-color, #ffffff);
}

.pcm-close {
    color: var(--pcm-header-text-color, #ffffff);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.pcm-close:hover {
    transform: scale(1.2);
}

#pcm-order-form {
    padding: 25px;
    background-color: var(--pcm-bg-color, #fff);
    border-radius: 0 0 var(--pcm-border-radius, 16px) var(--pcm-border-radius, 16px);
}

.pcm-form-group {
    margin-bottom: 20px;
}

.pcm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1e293b;
}

.pcm-form-group input,
.pcm-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.pcm-form-group input:focus,
.pcm-form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.pcm-required {
    color: #ef4444;
}

.pcm-checkbox-group {
    margin-top: 15px;
}

.pcm-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal !important;
}

.pcm-checkbox-label input {
    width: auto;
    margin-right: 10px;
    transform: scale(1.2);
}

.pcm-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--pcm-btn-bg-start, #d24e25) 0%, var(--pcm-btn-bg-end, #483b37) 100%);
    color: var(--pcm-btn-text-color, #ffffff);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pcm-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.pcm-submit-btn:active {
    transform: translateY(0);
}

.pcm-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pcm-message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.pcm-message.success {
    display: block;
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.pcm-message.error {
    display: block;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.pcm-captcha-group input {
    font-size: 18px;
    text-align: center;
}

/* Спиннер загрузки */
.pcm-loading {
    position: relative;
    pointer-events: none;
}

.pcm-loading:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== МОБИЛЬНАЯ АДАПТАЦИЯ ========== */
@media (max-width: 768px) {
    .pcm-modal {
        padding: 10px;
        align-items: flex-start;
    }
    
    .pcm-modal-content {
        margin: 10px auto;
        max-width: calc(100% - 20px);
    }
    
    .pcm-modal-content.pcm-width-percent {
        width: calc(100% - 20px);
    }
    
    .pcm-modal-content.pcm-width-px {
        width: calc(100% - 20px);
        max-width: calc(100% - 20px);
    }
    
    .pcm-modal-header {
        padding: 15px 20px;
    }
    
    .pcm-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .pcm-close {
        font-size: 24px;
    }
    
    #pcm-order-form {
        padding: 20px;
    }
    
    .pcm-form-group {
        margin-bottom: 15px;
    }
    
    .pcm-form-group input,
    .pcm-form-group textarea {
        padding: 10px;
        font-size: 16px; /* Предотвращает масштабирование на iOS */
    }
    
    .pcm-submit-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    .pcm-order-button {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .pcm-position-fixed,
    .pcm-position-floating {
        bottom: 15px;
        right: 15px;
        left: auto;
    }
    
    .pcm-position-floating {
        left: 15px;
        right: auto;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .pcm-modal-header h2 {
        font-size: 1rem;
    }
    
    #pcm-order-form {
        padding: 15px;
    }
    
    .pcm-form-group label {
        font-size: 14px;
    }
    
    .pcm-row {
        flex-direction: column;
        gap: 10px;
    }
}

/* Для планшетов */
@media (min-width: 769px) and (max-width: 1024px) {
    .pcm-modal-content.pcm-width-percent {
        width: 80%;
    }
    
    .pcm-modal-content.pcm-width-px {
        width: 600px;
    }
}
