/**
 * Стили для Logistics Solutions на странице checkout
 */

/* Скрываем поле выбора страны (доставка только в Кыргызстан) */
#billing_country_field {
    display: none !important;
}

/* Контейнер выбора ПВЗ */
.logistic-warehouse-selector {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: none;
    width: 100%;
    clear: both; /* Очищаем float если поле страны использует float */
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

/* Обязательное поле ПВЗ (когда не выбран) */
.logistic-warehouse-selector.required-field {
    border: 2px solid #e53935;
    background: #ffebee;
}

.logistic-warehouse-selector.active,
.logistic-warehouse-selector[style*="display: block"] {
    display: block !important;
}

.logistic-warehouse-selector h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
    color: #333;
    display: inline-block;
}

.logistic-warehouse-selector h3 .required {
    color: #e53935;
    font-weight: bold;
    margin-left: 3px;
}

/* Кнопка "Изменить ПВЗ" */
.logistic-change-pvz-btn {
    margin-left: 15px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #1976d2;
    color: #1976d2;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.logistic-change-pvz-btn:hover {
    background: #1976d2;
    color: #fff;
}

.logistic-info-text {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

/* Подсказка для обязательного поля */
.logistic-warehouse-selector.required-field .logistic-info-text {
    color: #c62828;
    font-weight: 500;
}

.logistic-warehouse-selector.required-field .logistic-info-text::before {
    content: "! ";
    margin-right: 5px;
}

.logistic-warehouse-search {
    margin-bottom: 15px;
}

.logistic-warehouse-search input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.logistic-warehouse-search input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 1px #1976d2;
}

.logistic-warehouse-list {
    max-height: 450px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.logistic-warehouse-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logistic-warehouse-item:hover {
    background: #f5f5f5;
}

.logistic-warehouse-item:last-child {
    border-bottom: none;
}

.logistic-warehouse-city {
    font-weight: 600;
    margin-bottom: 5px;
    color: #1976d2;
    font-size: 14px;
}

.logistic-warehouse-address {
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
    font-size: 15px;
}

.logistic-warehouse-details {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.logistic-warehouse-details span {
    margin-right: 15px;
    display: inline-block;
}

/* Сообщения */
.logistic-message {
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.logistic-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.logistic-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.logistic-message.info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

/* Загрузка */
.logistic-loading {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-size: 14px;
}

.logistic-loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #1976d2;
    border-radius: 50%;
    animation: logistic-spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* Скрытие полей адреса при выборе ПВЗ */
body.logistic-pvz-selected #billing_address_1_field,
body.logistic-pvz-selected #billing_state_field,
body.logistic-pvz-selected #billing_postcode_field {
    display: none !important;
}

/* Подсказка для поля адреса */
#billing_address_1_field .woocommerce-input-wrapper::after {
    content: "Введите полный адрес";
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

body.logistic-pvz-selected #billing_address_1_field .woocommerce-input-wrapper::after {
    display: none;
}

/* Стили для выбранного ПВЗ */
.logistic-warehouse-item.selected {
    background: #e3f2fd !important;
    border-left: 4px solid #1976d2;
    padding-left: 11px;
}

.logistic-warehouse-item.selected .logistic-warehouse-city::before {
    content: "v ";
    color: #1976d2;
    font-weight: bold;
    margin-right: 5px;
}

/* Адаптив */
@media (max-width: 768px) {
    .logistic-warehouse-selector {
        padding: 15px;
        margin: 15px 0;
    }
    
    .logistic-warehouse-list {
        max-height: 350px;
    }
    
    .logistic-warehouse-item {
        padding: 12px;
    }
    
    .logistic-warehouse-selector h3 {
        font-size: 16px;
    }
}

/* Скроллбар для списка ПВЗ */
.logistic-warehouse-list::-webkit-scrollbar {
    width: 8px;
}

.logistic-warehouse-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.logistic-warehouse-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.logistic-warehouse-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Стили для методов доставки */
.woocommerce-shipping-methods li {
    transition: all 0.3s ease;
    margin-bottom: 8px !important;
    display: inline-block;
    width: auto;
}

.woocommerce-shipping-methods li input[type="radio"] {
    cursor: pointer;
    display: none;
}

.woocommerce-shipping-methods li label {
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

/* Выбранный метод - делаем более выделенным */
.woocommerce-shipping-methods li:has(input:checked) label {
    background-color: #f0f7ff;
    border: 1px solid #2196F3;
    font-weight: 600;
    color: #1976D2;
}

/* Невыбранные методы - обычные, не затемняем */
.woocommerce-shipping-methods li:not(:has(input:checked)) label {
    background-color: transparent;
    border: 1px solid #ddd;
    font-weight: 400;
    color: #333;
}

/* Hover эффект для всех методов */
.woocommerce-shipping-methods li label:hover {
    background-color: #f5f5f5;
    border-color: #999;
}


/* City suggestions */
.logistic-city-suggestions {
    margin-top: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    max-height: 240px;
    overflow-y: auto;
    display: none;
}

.logistic-city-suggestions-list {
    margin: 0;
    padding: 0;
}

.logistic-city-suggestion {
    padding: 8px 12px;
    cursor: pointer;
}

.logistic-city-suggestion:hover {
    background: #f5f5f5;
}

.logistic-city-region {
    color: #666;
    font-size: 12px;
    margin-left: 6px;
}

.logistic-region-selector {
    margin-top: 10px;
}

.logistic-region-selector label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #333;
}

.logistic-region-selector select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.logistic-region-selector select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 1px #1976d2;
}

