/* Nova Poshta Widget Styles - Dark Theme with Pink Accents */

/* Простая розовая кнопка как у InPost "Wybierz punkt InPost" - розовый фон, белый текст, на всю ширину */
.nova-poshta-widget-button {
    display: none; /* Скрыта по умолчанию, показывается через showButtonState() */
    width: 100% !important; /* На всю ширину блока */
    padding: 12px 20px;
    border: 2px solid #ec008c !important; /* Розовая рамка (#ec008c) */
    border-radius: 8px;
    font-family: Inter, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    font-weight: 400; /* Обычный текст, не жирный */
    color: #ffffff !important; /* Белый текст */
    background-color: #ec008c !important; /* Розовый фон (#ec008c) */
    cursor: pointer;
    text-align: center !important; /* По центру */
    box-sizing: border-box;
    margin: 10px 0 20px 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(236, 0, 140, 0.2);
    outline: none;
}

/* Старая кнопка - удаляем, оставляем для совместимости */
.nova-poshta-button {
    display: none !important;
}

.nova-poshta-selected {
    display: flex;
    flex-direction: column;
}

/* Hover новой кнопки - более темный розовый фон */
.nova-poshta-widget-button:hover {
    border-color: #d0007a !important;
    box-shadow: 0 2px 12px rgba(236, 0, 140, 0.4);
    background-color: #d0007a !important; /* Более темный розовый при hover */
    color: #ffffff !important; /* Белый текст сохраняется */
}

.nova-poshta-widget-button:active {
    background-color: #b40068 !important; /* Еще более темный при нажатии */
    box-shadow: 0 1px 4px rgba(236, 0, 140, 0.3);
    color: #ffffff !important;
}

.nova-poshta-selected:hover {
    border-color: #27ae60;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
}

.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 (больше не используется) */

.nova-poshta-selected .angle svg path {
    fill: #d1d1d7;
}

.nova-poshta-selected:hover .angle svg path {
    fill: #d75cb6;
}

.nova-poshta-button .wrapper,
.nova-poshta-selected .wrapper {
    display: flex;
    flex-direction: column;
    font-family: Inter, sans-serif;
    font-weight: 500;
}

/* Текст на кнопке - розовый как у InPost */
.nova-poshta-button .text {
    font-size: 16px;
    line-height: 21px;
    color: #d75cb6 !important;
    margin-bottom: 0;
}

/* Удаляем старые стили для .nova-poshta-button (больше не используется) */

.nova-poshta-selected .text {
    font-size: 16px;
    line-height: 21px;
    color: #2c3e50;
    margin-bottom: 0;
}

.nova-poshta-selected .text-description {
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    color: #495057;
    margin-top: 2px;
}

/* Выбранное состояние - светлый блок как у InPost "Wybrany punkt" */
.nova-poshta-selected {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border: none !important;
    border-left: 4px solid #27ae60 !important; /* Только толстая левая граница */
    border-top: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 15px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: none; /* Скрыт по умолчанию, показывается через showSelectedState() */
    flex-direction: column;
}

/* Заголовок "Wybrany punkt:" - зеленый */
.nova-poshta-selected-header {
    font-weight: 600;
    color: #27ae60 !important;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Контент с именем и адресом - как в InPost */
.nova-poshta-selected-content {
    color: #495057; /* Как в InPost */
    line-height: 1.4; /* Как в InPost */
    margin-bottom: 10px;
    word-wrap: break-word; /* Как в InPost */
}

.nova-poshta-selected-name {
    font-weight: 400; /* Обычный текст, не жирный (как в InPost) */
    color: #495057 !important; /* Серый цвет как у адреса */
    font-size: 14px; /* Одинаковый размер как в InPost */
    margin-bottom: 4px;
    line-height: 1.4; /* Как в InPost */
}

.nova-poshta-selected-address {
    display: none; /* Скрываем адрес полностью */
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
}

/* Кнопка "Изменить" в светлом блоке - как в InPost */
.nova-poshta-selected .change-button {
    background: transparent !important; /* Как в InPost */
    border: 1px solid #6c757d !important; /* Как в InPost */
    color: #6c757d !important; /* Как в InPost */
    padding: 6px 12px !important; /* Как в InPost */
    border-radius: 3px !important; /* Как в InPost */
    cursor: pointer !important;
    font-size: 12px !important; /* Как в InPost */
    font-weight: 400 !important; /* Обычный текст, не жирный (как в InPost) */
    transition: all 0.3s ease !important;
    margin-top: 10px !important;
    align-self: flex-start !important;
    width: auto !important;
    outline: none !important;
}

.nova-poshta-selected .change-button:hover {
    background: #6c757d !important; /* Как в InPost */
    color: #ffffff !important; /* Как в InPost */
}

.nova-poshta-selected .change-button:focus {
    box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.3) !important; /* Как в InPost */
}

/* Кнопка выбора всегда розовая - удаляем класс selected, не нужен */

/* Стили для модального окна - дефолтные Nova Poshta (белый фон) */
.modal-overlay,
.novaposhta-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: 10000;
}

.modal,
.novaposhta-modal {
    position: relative;
    width: 80%;
    height: 80%;
    background-color: #ffffff;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.modal-header,
.novaposhta-modal-header {
    position: relative;
    height: 80px;
    padding: 0 20px;
    border-bottom: 1px solid #e5e7eb;
    line-height: 80px;
    background: #ffffff;
}

.modal-header h2,
.novaposhta-modal-header h2 {
    margin: 0;
    font-family: Inter, sans-serif;
    font-size: 20px;
    line-height: 80px;
    font-weight: 600;
    color: #1a202c;
}

.modal-close,
.novaposhta-modal-close {
    cursor: pointer;
    font-size: 32px;
    color: #475569;
    position: absolute;
    right: 20px;
    border: none !important; /* Убираем рамку */
    background: none !important; /* Убираем фон */
    padding: 0 !important; /* Убираем отступы */
    top: 0;
    width: 40px;
    height: 100%;
    line-height: 80px;
    text-align: center;
    transition: color 0.3s ease;
}

.modal-close:hover,
.novaposhta-modal-close:hover {
    color: #1a202c;
}

.modal-iframe,
.modal-content,
.novaposhta-modal-iframe {
    width: 100%;
    height: calc(100% - 81px);
    border: none;
    background: #ffffff;
}

.novaposhta-button-container {
    width: 100% !important;
}

/* Адаптив для мобильных устройств */
@media screen and (max-width: 767px) {
    .modal,
    .novaposhta-modal {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        border: none;
        background-color: #ffffff;
    }

    .modal-header,
    .novaposhta-modal-header {
        display: none;
    }

    .modal-iframe,
    .modal-content,
    .novaposhta-modal-iframe {
        height: 100%;
        background: #ffffff;
    }

    .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;
}
