.location-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.location-header .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding: 0 16px;
}

.location-header .back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-warm);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.location-header .back-btn:hover {
    background: var(--bg);
}

.location-header .back-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--text-primary);
}

.location-header .header-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.location-header .header-placeholder {
    width: 36px;
}

.location-main {
    padding-top: 50px;
    min-height: 100vh;
    background: var(--bg);
}

.location-container {
    padding: 16px;
}

.location-section {
    margin-bottom: 24px;
}

.location-section.hidden {
    display: none;
}

.location-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.location-section .section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.location-section .clear-btn {
    font-size: 0.8rem;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.location-section .clear-btn:hover {
    background: rgba(255, 85, 46, 0.1);
}

.location-section .country-link {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    background: rgba(255, 85, 46, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    white-space: nowrap;
}

.location-section .country-link:hover {
    background: rgba(255, 85, 46, 0.18);
}

.location-section .country-link.hidden {
    display: none;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    margin-bottom: 12px;
}

.search-box .search-icon {
    width: 18px;
    height: 18px;
    fill: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    padding: 10px 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.country-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.country-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 12px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    gap: 10px;
}

.country-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.country-card.active {
    border-color: var(--primary);
    background: rgba(255, 85, 46, 0.05);
}

.country-card .country-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-card.hidden {
    display: none;
}

.country-card .check-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    fill: var(--primary);
}

.city-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.city-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.city-item:hover {
    border-color: var(--primary);
}

.city-item.active {
    border-color: var(--primary);
    background: rgba(255, 85, 46, 0.05);
}

.city-item .city-name {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.city-item .check-icon {
    width: 14px;
    height: 14px;
    fill: var(--primary);
}

.city-item .city-tag {
    font-size: 0.65rem;
    color: var(--primary);
    background: rgba(255, 85, 46, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.empty-cities {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.loading-cities {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.empty-cities svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.empty-cities p {
    font-size: 0.9rem;
    margin: 0;
}

.location-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.location-footer .confirm-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.location-footer .confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.location-footer .confirm-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

@media (max-width: 480px) {
    .country-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .country-card {
        padding: 12px 4px;
    }
    
    .country-card .country-name {
        font-size: 0.8rem;
    }
    
    .city-item {
        padding: 6px 12px;
    }
    
    .city-item .city-name {
        font-size: 0.8rem;
    }
}