/* Стили для виджета с использованием переменных */
:root {
    --cd-primary: #007cba;
    --cd-text: #ffffff;
}

#custom-delivery-widget-root {
    margin: 20px 0;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.cd-search-box {
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.cd-search-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.cd-tab.active {
    color: var(--cd-primary);
    border-bottom: 2px solid var(--cd-primary);
    background: rgba(0, 124, 186, 0.05);
}

.custom-delivery-card.selected {
    border-color: var(--cd-primary);
    background: rgba(0, 124, 186, 0.05);
}

.cd-select-btn {
    background: var(--cd-primary);
    color: var(--cd-text);
}

/* Стили для карточки товара */
.cd-product-box {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid var(--cd-primary);
    border-radius: 4px;
    font-size: 14px;
}

.cd-price {
    color: var(--cd-primary);
    font-weight: bold;
}

/* Левая панель (Сайдбар) */
.custom-delivery-sidebar {
    width: 350px;
    border-right: 1px solid #e2e2e2;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.custom-delivery-sidebar h3 {
    margin: 0;
    padding: 15px;
    font-size: 16px;
    border-bottom: 1px solid #e2e2e2;
    background: #fff;
}

/* Вкладки ПВЗ / Курьер */
.custom-delivery-tabs {
    display: flex;
    border-bottom: 1px solid #e2e2e2;
    background: #fff;
}

.cd-tab {
    flex: 1;
    padding: 12px 10px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    outline: none;
    transition: all 0.2s;
}

.cd-tab:hover {
    background: #f5f5f5;
}

.cd-tab.active {
    color: #007cba;
    border-bottom: 2px solid #007cba;
    background: #f0f8ff;
}

/* Список ПВЗ */
.custom-delivery-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-delivery-card {
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    line-height: 1.4;
}

.custom-delivery-card:hover {
    border-color: #007cba;
}

.custom-delivery-card.selected {
    border-color: #007cba;
    background: #f0f8ff;
    box-shadow: 0 0 0 1px #007cba;
}

/* Правая панель (Карта) */
.custom-delivery-map-area {
    flex: 1;
    position: relative;
}

#custom-delivery-map {
    width: 100%;
    height: 100%;
    background: #eaeaea;
}

.cd-no-map {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
    padding: 20px;
    text-align: center;
    line-height: 1.5;
}

/* Кнопка в балуне карты */
.cd-select-btn {
    margin-top: 10px;
    padding: 8px 12px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    transition: background 0.2s;
}

.cd-select-btn:hover {
    background: #006ba1;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .custom-delivery-container {
        flex-direction: column-reverse;
        height: auto;
    }
    .custom-delivery-sidebar {
        width: 100%;
        height: 350px;
        border-right: none;
        border-top: 1px solid #e2e2e2;
    }
    .custom-delivery-map-area {
        height: 350px;
    }
}
