/**
 * CDEK Shipping Module - Frontend Styles
 */

.cdek-container {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cdek-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.cdek-city-selector {
    margin-bottom: 20px;
}

.cdek-city-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.cdek-city-selector select {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

#cdek-map {
    border: 2px solid #00aff0;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#cdek-map-container {
    display: block !important;
}

#cdek-pickup-info {
    margin-bottom: 20px;
}

#cdek-pickup-info h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: bold;
}

#cdek-selected-info {
    padding: 15px;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    color: #0c5460;
}

#cdek-selected-info p {
    margin: 5px 0;
}

#cdek-selected-info strong {
    font-weight: bold;
    font-size: 15px;
}

.cdek-points-list {
    margin-top: 20px;
}

.cdek-points-list h4 {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: bold;
}

#cdek-points-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.cdek-point-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.cdek-point-item:last-child {
    border-bottom: none;
}

.cdek-point-item:hover {
    background-color: #f5f5f5;
}

.cdek-point-item.selected {
    background-color: #e7f3ff;
    border-left: 4px solid #007bff;
}

.cdek-point-item h5 {
    margin: 0 0 10px 0;
    font-size: 15px;
    font-weight: bold;
    color: #333;
}

.cdek-point-item p {
    margin: 5px 0;
    font-size: 13px;
    color: #666;
}

.cdek-point-item button {
    margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .cdek-container {
        padding: 15px;
    }

    #cdek-map {
        height: 300px !important;
    }

    .cdek-city-selector select {
        max-width: 100%;
    }
}

/* Loading spinner */
#cdek-loading {
    text-align: center;
    padding: 40px;
    background: #f0f0f0;
    border-radius: 4px;
    margin: 20px 0;
}

#cdek-loading:after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #00aff0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Buttons */
.cdek-point-item .btn-primary,
.cdek-container .btn-primary {
    background-color: #00aff0;
    border-color: #00aff0;
    color: #fff;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cdek-point-item .btn-primary:hover,
.cdek-container .btn-primary:hover {
    background-color: #0099d6;
    border-color: #0088c2;
}

/* Яндекс карта - убираем рекламу */
ymaps[class*="copyrights-pane"] {
    opacity: 0.5;
}

/* Уведомления */
.cdek-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    min-width: 250px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Улучшенный вид */
.cdek-container {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.cdek-points-list h4 {
    color: #00aff0;
}

/* Скрыть пустой контейнер до загрузки */
#cdek-points-container:empty {
    display: none;
}
