/* Стили для выпадающего поиска в стиле сайта */
.dellin-search-container {
    margin-bottom: 20px;
}

.terminal-select-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.terminal-search-input {
    width: 100%;
    padding: 12px 50px 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: white;
    outline: none;
    color: #333;
}

.terminal-search-input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.terminal-search-input::placeholder {
    color: #999;
}

.search-controls {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-search-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: #007cba;
    color: white;
}

.terminal-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 2px solid #007cba;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    margin: 0;
    padding: 0;
    list-style: none;
}

.terminal-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s ease;
}

.terminal-item:last-child {
    border-bottom: none;
}

.terminal-item:hover {
    background-color: #f8f9fa;
}

.terminal-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 2px;
}

.terminal-city {
    font-size: 12px;
    color: #007cba;
    font-weight: 500;
}

.no-results {
    padding: 16px;
    text-align: center;
    color: #999;
    font-style: italic;
    cursor: default;
}

/* Карта */
.dellin-map-wrapper {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    position: relative;
    border: 1px solid #e0e0e0;
    min-height: 400px;
}

.dellin-map {
    border-radius: 8px;
    min-height: 400px !important;
    height: 500px !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Принудительные стили для меток Яндекс.Карт */
.ymaps-2-1-79-placemark-overlay {
    z-index: 1000 !important;
}

.ymaps-2-1-79-geoObject-overlay {
    z-index: 1000 !important;
}

/* Убеждаемся что контейнер карты имеет правильную высоту */
.dellin-container {
    width: 100%;
}

/* Стили балуна */
.dellin-terminal-balloon {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 320px;
    padding: 4px 0;
}

.balloon-row {
    display: flex;
    margin-bottom: 8px;
    align-items: flex-start;
}

.balloon-row:last-child {
    margin-bottom: 0;
}

.balloon-label {
    font-weight: 600;
    color: #666;
    min-width: 100px;
    font-size: 13px;
    margin-right: 12px;
}

.balloon-value {
    color: #333;
    font-size: 13px;
    line-height: 1.4;
    flex: 1;
}

.balloon-value a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
}

.balloon-value a:hover {
    text-decoration: underline;
}

.dellin-balloon-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

/* Ошибки */
.dellin-error {
    padding: 24px;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    font-weight: 500;
}

/* Скроллбар для списка */
.terminal-dropdown::-webkit-scrollbar {
    width: 6px;
}

.terminal-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.terminal-dropdown::-webkit-scrollbar-thumb {
    background: #007cba;
    border-radius: 3px;
}

.terminal-dropdown::-webkit-scrollbar-thumb:hover {
    background: #005a8b;
}

/* Стили для списка терминалов (если включен) */
.dellin-terminals-list {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.dellin-terminals-list h3 {
    margin: 0 0 24px 0;
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
}

.terminals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.terminal-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e8e8e8;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.terminal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #007cba 0%, #005a8b 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.terminal-card:hover::before {
    transform: scaleX(1);
}

.terminal-card:hover {
    border-color: #007cba;
    box-shadow: 0 12px 40px rgba(0, 124, 186, 0.15);
    transform: translateY(-4px);
}

.terminal-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f5f5f5;
}

.terminal-header h4 {
    margin: 0 0 8px 0;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.terminal-city {
    color: #007cba;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, #e6f3ff 0%, #cce7ff 100%);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    border: 1px solid #b3d9ff;
}

.terminal-details {
    margin-bottom: 20px;
}

.terminal-details p {
    margin: 12px 0;
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.5;
}

.terminal-details .detail-icon {
    width: 20px;
    height: 20px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 2px;
}

.terminal-details strong {
    color: #333;
    font-weight: 600;
}

.terminal-details a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.terminal-details a:hover {
    color: #005a8b;
    text-decoration: underline;
}

.show-on-map-btn {
    background: linear-gradient(135deg, #007cba 0%, #005a8b 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.show-on-map-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.show-on-map-btn:hover::before {
    left: 100%;
}

.show-on-map-btn:hover {
    background: linear-gradient(135deg, #005a8b 0%, #004a75 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 124, 186, 0.3);
}

.show-on-map-btn:active {
    transform: translateY(0);
}

/* Иконки в деталях */
.terminal-details p:nth-child(1) .detail-icon::before { content: "📍"; }
.terminal-details p:nth-child(2) .detail-icon::before { content: "📞"; }
.terminal-details p:nth-child(3) .detail-icon::before { content: "🕒"; }

/* Адаптивность */
@media (max-width: 768px) {
    .dellin-container {
        margin: 15px -10px;
    }
    
    .terminal-select-wrapper {
        max-width: 100%;
        margin: 0 10px;
    }
    
    .terminal-search-input {
        padding: 10px 45px 10px 14px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .dellin-map-wrapper {
        border-radius: 0;
        margin-bottom: 20px;
        border-left: none;
        border-right: none;
        min-height: 350px;
    }
    
    .dellin-map {
        border-radius: 0;
        min-height: 350px !important;
        height: 400px !important;
    }
    
    .terminal-dropdown {
        max-height: 250px;
    }
    
    .terminal-item {
        padding: 10px 14px;
    }
    
    .dellin-terminals-list {
        border-radius: 0;
        padding: 20px 15px;
        border-left: none;
        border-right: none;
    }
    
    .dellin-terminals-list h3 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .terminals-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .terminal-card {
        padding: 20px;
        border-radius: 8px;
    }
    
    .terminal-header h4 {
        font-size: 16px;
    }
    
    .terminal-details p {
        font-size: 13px;
        gap: 10px;
    }
    
    .show-on-map-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .dellin-terminals-list {
        padding: 15px 10px;
    }
    
    .terminal-card {
        padding: 16px;
    }
    
    .terminals-grid {
        gap: 12px;
    }
    
    .dellin-map {
        min-height: 300px !important;
        height: 350px !important;
    }
}
