#flagpole-configurator {
    max-width: 540px;
    margin: 5px 0;
    padding: 5px;
    border: none;
    background: #FFFFFF;
    font-family: Arial, sans-serif;
}

.flagpole-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.flagpole-option-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flagpole-option {
    width: 110px;
    height: 110px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 5px;
    box-sizing: border-box;
}

.flagpole-option.selected {
    border-color: #f58220;
    background-color: #fff5f0;
}

.flagpole-option img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

/* Скрываем подписи внутри кнопок в десктопной версии */
.flagpole-option .descr {
    display: none;
}

.flagpole-caption {
    font-size: 13px;
    text-align: center;
    margin-top: 5px;
    max-width: 110px;
    line-height: 1.2;
}

.flagpole-counter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

/* Объединенные стили для элементов счетчика */
.flagpole-counter-btn,
.flagpole-counter-value {
    height: 35px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.flagpole-counter-btn {
    width: 35px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.flagpole-counter-btn:hover {
    background: #e9ecef;
}

.flagpole-counter-value {
    width: 65px;
    text-align: center;
    padding: 0 5px;
}

/* Базовые стили для всех кнопок */
.flagpole-btn,
.order-btn {
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.flagpole-btn {
    padding: 12px 20px;
    margin-right: 10px;
    margin-bottom: 10px;
    font-size: 14px;
}

.flagpole-btn.calc {
    background: #28a745;
    color: white;
}

.flagpole-btn.calc:hover {
    background: #218838;
}

.flagpole-btn.order {
    background: #f58220;
    color: white;
}

.flagpole-btn.order:hover {
    background: #e0751a;
}

/* Базовые стили для модальных окон */
.modal-overlay,
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay {
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.notification-overlay {
    z-index: 2000;
    pointer-events: none;
}

.notification-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    background: white;
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    border-radius: 8px;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.order-params {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    line-height: 1.5;
}

#orderForm label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* ИСПРАВЛЕНО: исключили checkbox из общих стилей input */
#orderForm input:not([type="checkbox"]), 
#orderForm textarea, 
#orderForm select {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

#orderForm textarea {
    resize: vertical;
}

/* Специфичные стили для form-check внутри #orderForm */
#orderForm .form-check {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 15px !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#orderForm .form-check input[type="checkbox"],
#orderForm .form-check-input {
    width: auto !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    min-width: 18px !important;
    padding: 0 !important;
    border: 1px solid #ddd !important;
    height: auto !important;
}

#orderForm .form-check label,
#orderForm .form-check-label {
    font-weight: normal !important;
    margin: 0 !important;
    flex: 1 !important;
    line-height: 1.4 !important;
    text-align: left !important;
    word-break: break-word !important;
    display: block !important;
    margin-bottom: 0 !important;
}

.order-btn {
    background: #f58220 !important;
    color: white !important;
    padding: 12px 30px !important;
    font-size: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.order-btn:hover {
    background: #e0751a !important;
}

.order-btn:disabled {
    background: #6c757d !important;
    cursor: not-allowed !important;
}

.order-status {
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
    text-align: center;
    font-weight: bold;
}

.notification-center {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
}

.notification-center.success {
    border-left: 5px solid #28a745;
}

.notification-center.error {
    border-left: 5px solid #dc3545;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.notification-icon {
    font-size: 20px;
    margin-top: 2px;
}

.notification-message {
    margin: 0;
    line-height: 1.4;
    color: #333 !important;
}

.notification-message:empty::after {
    content: "Ваше сообщение отправлено. Мы свяжемся с вами в ближайшее время. Спасибо!";
    color: #333 !important;
}

/* Мобильная версия */
@media (max-width: 600px) {
    #flagpole-configurator {
        padding: 10px !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .flagpole-options {
        gap: 8px !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        flex-direction: row !important;
        align-items: stretch !important;
    }
    
    .flagpole-option-wrap {
        width: 100%;
        margin: 0 !important;
    }
    
    .flagpole-option {
        width: 100% !important;
        height: 45px !important;
        padding: 8px !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex-shrink: 1 !important;
    }
    
    .flagpole-option img {
        display: none !important;
    }
    
    .flagpole-option .descr {
        display: block !important;
        font-size: 12px !important;
        text-align: center !important;
        margin: 0 !important;
        line-height: 1.2 !important;
    }
    
    .flagpole-caption {
        display: none !important;
    }
    
    .flagpole-counter-btn {
        color: #f58220 !important;
        border-color: #f58220 !important;
    }
    
    .flagpole-counter-btn:hover {
        background: #fff5f0 !important;
    }
    
    .flagpole-btn {
        width: 100% !important;
        margin: 0 0 10px 0 !important;
        display: block !important;
        text-align: center !important;
        padding: 10px 15px !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    
    .flagpole-counter {
        justify-content: center !important;
        margin: 15px 0 !important;
    }
    
    .modal-window {
        width: 95% !important;
        margin: 10px auto !important;
        padding: 15px !important;
    }
    
    #orderForm .form-check {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        margin-bottom: 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 !important;
    }
    
    #orderForm .form-check input[type="checkbox"],
    #orderForm .form-check-input {
        margin: 0 !important;
        flex-shrink: 0 !important;
        min-width: 18px !important;
    }
    
    #orderForm .form-check label,
    #orderForm .form-check-label {
        margin: 0 !important;
        line-height: 1.4 !important;
        flex: 1 !important;
        word-break: break-word !important;
        max-width: calc(100% - 26px) !important;
    }
}
