/* intl-tel-input 核心样式 */
.iti {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* 国旗容器 */
.iti__flag-container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    padding: 1px 0 0 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-right: 0;
    border-radius: 4px 0 0 4px;
    cursor: pointer;
    z-index: 10;
    min-width: 80px;
}

/* 选中的国旗区域 */
.iti__selected-flag {
    padding: 0 6px 0 8px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* 国旗图标 */
.iti__flag {
    width: 20px;
    height: 15px;
    background-repeat: no-repeat;
    background-size: 20px auto;
}

/* 区号显示 */
.iti__selected-dial-code {
    color: #666;
    font-size: 12px;
    margin-left: 8px;
    font-weight: 500;
}

/* 下拉箭头 */
.iti__arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #555;
    margin-left: 6px;
    transition: transform 0.2s;
}

.iti__arrow--up {
    transform: rotate(180deg);
}

/* 下拉菜单 - 关键样式 */
.iti__dropdown-content {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 150px !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-top: 0 !important;
    border-radius: 0 0 4px 4px !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    z-index: 10000 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    display: block !important;
}

/* 隐藏状态 */
.iti__dropdown-content.iti__hide {
    display: none !important;
}

/* 国家选项 */
.iti__country {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f0f0f0;
}

.iti__country:hover {
    background: #f5f5f5;
}

.iti__country.iti__active {
    background: #e3f2fd;
}

/* 国旗盒子 */
.iti__flag-box {
    margin-right: 8px;
}

/* 国家名称 - 隐藏 */
.iti__country-name {
    display: none;
}

/* 区号 */
.iti__dial-code {
    color: #666;
    font-size: 12px;
    margin-left: 8px;
}

/* 输入框样式 */
.iti input[type="tel"] {
    width: 100%;
    padding: 8px 12px 8px 90px; /* 左侧留出空间给国旗和区号 */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

/* 确保容器不裁剪下拉菜单 */
.mobile-input {
    position: relative;
    overflow: visible;
}

.form-group {
    position: relative;
    overflow: visible;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .iti__flag-container {
        min-width: 70px;
        padding: 1px 0 0 6px;
    }
    
    .iti__selected-flag {
        padding: 0 4px 0 6px;
        width: 100%;
    }
    
    .iti input[type="tel"] {
        padding-left: 80px;
    }
}
