/* Nova Poshta Widget Styles */

.nova-poshta-button,
.nova-poshta-selected {
    display: flex;
    flex-direction: column;
    padding: 11px 40px 11px 16px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    font-family: Inter, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #fff;
    cursor: pointer;
    max-width: 344px;
    position: relative;
    box-sizing: border-box;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.nova-poshta-button:hover,
.nova-poshta-selected:hover {
    border-color: #0073e6;
    box-shadow: 0 2px 8px rgba(0, 115, 230, 0.15);
}

.nova-poshta-button.button-horizontal,
.nova-poshta-selected.button-horizontal {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.nova-poshta-button .logo,
.nova-poshta-selected .logo {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.nova-poshta-button .logo svg,
.nova-poshta-selected .logo svg {
    width: 28px;
    height: 28px;
    margin-right: 10px;
}

.nova-poshta-button .angle,
.nova-poshta-selected .angle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 20px;
    height: 16px;
}

.nova-poshta-button .wrapper,
.nova-poshta-selected .wrapper {
    display: flex;
    flex-direction: column;
    font-family: Inter, sans-serif;
    font-weight: 500;
}

.nova-poshta-button .text,
.nova-poshta-selected .text {
    font-size: 16px;
    line-height: 21px;
    color: #1a202c;
    margin-bottom: 0;
}

.nova-poshta-button .text-description,
.nova-poshta-selected .text-description {
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    color: #475569;
    margin-top: 2px;
}

/* Стили для модального окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    position: relative;
    width: 80%;
    height: 80%;
    background-color: white;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.modal-header {
    position: relative;
    height: 80px;
    padding: 0 20px;
    border-bottom: 1px solid #E2E8F0;
    line-height: 80px;
    background: #f8f9fa;
}

.modal-header h2 {
    margin: 0;
    font-family: Inter, sans-serif;
    font-size: 20px;
    line-height: 80px;
    font-weight: 600;
    color: #2c3e50;
}

.modal-close {
    cursor: pointer;
    font-size: 32px;
    color: #333;
    position: absolute;
    right: 20px;
    top: 0;
    width: 40px;
    height: 100%;
    line-height: 80px;
    text-align: center;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #0073e6;
}

.modal-iframe {
    width: 100%;
    height: calc(100% - 81px);
    border: none;
}

.modal-content {
    width: 100%;
    height: calc(100% - 81px);
    border: none;
}

/* Стили для кнопки изменения */
.change-button {
    background: transparent !important;
    border: 1px solid #0073e6 !important;
    color: #0073e6 !important;
    padding: 5px 15px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    margin-top: 10px !important;
    align-self: flex-start !important;
}

.change-button:hover {
    background: #0073e6 !important;
    color: white !important;
}

/* Адаптив для мобильных устройств */
@media screen and (max-width: 767px) {
    .modal {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .modal-header {
        display: none;
    }

    .modal-iframe,
    .modal-content {
        height: 100%;
    }

    .nova-poshta-button,
    .nova-poshta-selected {
        max-width: 100%;
        margin-bottom: 15px;
    }
}

@media screen and (max-width: 480px) {
    .nova-poshta-button,
    .nova-poshta-selected {
        padding: 15px;
        padding-right: 40px;
    }

    .nova-poshta-button .text,
    .nova-poshta-selected .text {
        font-size: 14px;
        line-height: 18px;
    }

    .nova-poshta-button .text-description,
    .nova-poshta-selected .text-description {
        font-size: 12px;
        line-height: 16px;
    }
}

/* Интеграция с формами Битрикс */
.bx-soa-section .nova-poshta-button,
.bx-soa-section .nova-poshta-selected {
    margin: 10px 0;
    width: 100%;
    max-width: none;
}

/* Интеграция с Аспро шаблонами */
.aspro-form .nova-poshta-button,
.aspro-form .nova-poshta-selected {
    margin: 15px 0;
}

/* Дополнительные стили для выбранного состояния */
.nova-poshta-selected {
    background: linear-gradient(135deg, #f0f8ff 0%, #e8f4fd 100%);
    border-color: #0073e6;
}

.nova-poshta-selected .text {
    color: #0073e6;
    font-weight: 600;
}